The history command can be used to retrieve the the commands you have previously typed in a shell.

learn more… | top users | synonyms

1
vote
1answer
16 views

Bash reverse-i-search wrong prompt output

After modifying my .bashrc to add color to prompt, reverse-i-search output formatting is messed up. Typing CTRL+R to start a new search, prompt output is OK: After pressing right arrow to modify ...
121
votes
8answers
307k views

How to clear bash history completely?

I want to clear all before command from history of my server. I use history -c it seems all things are cleared but when I ssh to the server,all commands are still there. How can I clear them ...
0
votes
2answers
30 views

Is there a way to make some entries in history “sticky”?

I use the history / CtrlR thing quite a bit, but from time to time either a command I use regularly (but not regularly enough, apparently) "fades out" behind my command history threshold, or some ...
29
votes
4answers
79k views

How to view the `.bash_history` file via command line?

I want to view the contents of my .bash_history file but don't know how to get there via the command line.
12
votes
3answers
10k views

bash doesn't keep history

I run Ubuntu 12.04, and for some reason bash does not keep my command history. the ~/.bash_history file contains only 3 commands that I typed a few months ago. How can I fix this? EDIT: here's the ...
82
votes
5answers
54k views

How do I show apt-get package management history via command line?

Is there a way to show the history of packages that were changed by apt-get via command line?
0
votes
0answers
19 views

How can I make a list of my most used commands including commands used including sudo [duplicate]

How can I make a list of my most used commands. I have tried the answer from How can I make a list with most used commands in terminal? but it does not include the names of the commands I used with ...
7
votes
3answers
2k views

How can I make a list with most used commands in terminal?

How can I make a list with most used commands in terminal? I know that this question may be unuseful for any future proposals for some of us, but even like this, the list can be useful when we don't ...
1
vote
5answers
2k views

bash shell output history file location

Where does the bash shell store the actual terminal session? I want to read the output of commands I used before. All I can find googling is how to store the output of a command. Since output is ...
6
votes
2answers
18k views

Save the terminal history to a file for print

My Ubuntu headless server is about to lose both hard drives(raid1). I already saved the most important stuff. Now I'm sitting in front of a Mac OS X client with the terminal open (ssh). I need to ...
203
votes
10answers
12k views

Terminal 'incognito mode'?

I use Terminal a lot, and sometimes I am running commands, which aren't things I don't want others to see, but more commands that if I accidentally arrowed up to and accidentally executed would cause ...
1
vote
0answers
24 views

How to Show History of Port State/Activity?

Let's say I have an open port on my PC like 6789. I use this port for a special purpose. But, suddenly I found the port 6789 is not listed in netstat -ntlp (port closed). How can I see the history of ...
1
vote
1answer
375 views

How to delete chat history in skype for only one contact in Linux

I'm trying to delete chat history for only one contact in Linux. I've tried sqlite: http://www.sqlite.org/download.html but it removes chat conversation for a while and after restart skype it ...
48
votes
3answers
18k views

Is it possible to make writing to .bash_history immediate?

I often open lots and lots of Terminals [Right now I have 7 open on this workspace] and I often search history with grep to find a command I've just written recently, but I don't want to hunt down the ...
4
votes
1answer
2k views

Increase or View all Stored History in Gedit

I would like to be able to see the last ~200 files opened in Gedit. I was able to increase the number it shows to 40 using this command: gconftool-2 --type int --set /apps/gedit-2/preferences/ui/...
44
votes
4answers
30k views

Bash history handling with multiple terminals

I use mainly Terminator, and it's usually opened with 3 split terminal windows. I also use Gnome terminal for various reasons. I'm wondering how is bash history handled in this case as I sometimes ...
-1
votes
1answer
106 views

Putty SSH client command history? [duplicate]

I connect to my server via Putty SSH client. With the key ↑ I see previous entered commands, one by one. I just wondering is there a some command, which show all previous entered commands out of a ...
0
votes
0answers
48 views

No more history in dash. I want it back

I don't see the applications I used already in the dashboard. I went in settings -> privacy, and the history use was already set. I unset it and set it again (who knows). I even rebooted, but nothing ...
0
votes
1answer
17 views

Same commands execute when restart terminal

So, some time ago, I copied csv data from a webpage into terminal to save it to a csv file, like echo "field1,field2,field3,...,fieldn, with about 20 lines of text. I did this because I couldn't ...
54
votes
3answers
91k views

How to see time stamps in bash history?

Is there any way I can see at what time the commands were executed from the bash history? We can see the order but is there any way I can get the time also? Bottom-Line: Execution time in the Bash ...
1
vote
0answers
13 views

Record date when command was executed in the terminal? [duplicate]

bash_history lists only the previous commands executed. Is it possible to record the times ie. date when they were executed?
0
votes
1answer
181 views

How to run an anonymous terminal session?

This question by Paranoid Panda asks about incognito terminal use. This means history is not recorded in bash_history; so you can't access commands that were entered during that session. However this ...
0
votes
1answer
69 views

Lost firefox tabs due to crash

I use the Save Session version 1.3.1.6.1 plugin in firefox to save my current sessions. I had kept 3 windows full of tabs for all almost a year when yesterday my firefox crashed. Now I can't find any ...
1
vote
1answer
39 views

How to record all modifications to directories, subdirectories and files in one session?

How can I record all the modifications to directories, subdirectories and files made during one session (ie. during login time)? For example, listing all the files/folders that were modified, and ...
1
vote
5answers
257 views

Creating command history list

Is there a way to display a list comprised of the last n terminal commands made by a particular user ?
-2
votes
3answers
64 views

Any way to see if a long running process bash command succeeded? [closed]

I have a long running process that was parsing text and my laptop died at some point because it was unplugged. I really don't want to unnecessarily run the process again because it takes over a day, ...
1
vote
1answer
108 views

How to remove command-line history from a specific time period?

How can I remove command-line history over a specific time period? Is it possible do so with only one command?
0
votes
0answers
49 views

Skype chat progress is not showing whole history when started

When I start Skype so it always shows up a window that is totally empty when I open a contact I have already written with. I always have to change the setting to From beginning so that I can see the ...
6
votes
4answers
19k views

Where are ALL ubuntu logs/terminal history stored

In what folders are the logs and key histories stored so that I may make a script to purge them. Is there a specific folder for the hibernation partition or a file by which it keeps the RAM data on ...
0
votes
0answers
14 views

ubuntu 14.04 after reboot I lost last history of commands [duplicate]

I have Ubuntu 14.04 and I observed that whenever I reboot or had to force reboot (power off) the machine, I lose the history of commands. Normally I lose most or all previous session commands. This ...
1
vote
1answer
113 views

When I paste a command instead of typing it why does it not get added to history

If I type in a command it is preserved in history, but If I copy and paste a command from other place it is not preserved in history which is annoying if I have to run it again. I think this happens ...
1
vote
2answers
52 views

Generate a log of all the installs on a system (whether apt-get/yum/pip/npm/…)

Is there a command (or specific syntax for history command) that generates (to screen or file) a log of all the installs on a system (whether they were through apt-get/yum/pip/npm/...). If possible, ...
2
votes
2answers
103 views

Get history of top 10 commands used [duplicate]

Is there any way to find out top 10 most used commands in history? Here top 10 means commands which I have used most of the time i.e. the commands whose used count is more than others.
67
votes
4answers
34k views

Bash history search, partial + up-arrow

I have searched, but not found anything on this. I am looking for a functionality in bash, using a terminal. Way back when, I had a user on a debian system, and a friend set me up with a convenient ...
3
votes
0answers
202 views

missing .bash_history [closed]

I cant find .bash_history file in my home directory. I do: echo $HISTFILE /home/myname/.bash_history But if I try to list the file with ls, I get: $ ls -l ~/.bash_history ls: cannot access /home/...
7
votes
4answers
4k views

How to view history of apt-get install?

How can I view the history of apt-get install commands that I have manually executed? It seems to me that all methods available show everything that has been installed right from the start of the ...
0
votes
2answers
149 views

How to prevent commands being removed from history?

I have noticed that when I go up through my commands using the arrow keys, UP and DOWN, that if I then edit a command, it edits it in history, and I can even remove a command like that, however I do ...
6
votes
3answers
232 views

Blank line in my bash.history?

I was taking a look at my .bash_history, and I found a blank line. I thought that I could have pressed "enter" while I was taking a look in the file. Is that normal? Or maybe I really pressed enter ...
42
votes
5answers
20k views

How to avoid duplicate entries in .bash_history

The same command is listed in my history again and again. How can I avoid this? I know it's possible via HISTCONTROL but I haven't found the right way.
13
votes
4answers
678 views

Run last command with all the letters transformed to lowercase

Many times I have run a command with all the letters in uppercase (maybe because CapsLock was on), and I pressed Enter before realising this. How can I run the last command with all the letters ...
1
vote
1answer
661 views

get list of all commands run in past with sudo apt-get install in terminal

As per command history in Ubuntu terminal we can see all previous command we run on system. I want to know how can we get all previous command which starts with some words/characters. Example : i ...
4
votes
1answer
87 views

What does '*' mean in the output to 'history' command?

I was seeing my history when I found a line with a * whereas, in general, the history has an output without any * I noticed this for the first time. When does this * appear and why? EDIT: ...
0
votes
2answers
133 views

history erase shell script not working

I am creating shelll script that is erase history of commands in the terminal. But the script is not erase the history of commands in the terminal. I follow below procedure 1. My script contains ...
2
votes
1answer
76 views

Pasted commands do not appear in history

when I use copy and paste to run a command, and later I want to run the command again it doesn't appear in history. Sometimes if I paste and then change some of the arguments the command does appear ...
13
votes
3answers
21k views

How to save terminal history manually?

It's my understanding that the history file is updated when the terminal exits. But sometimes my computer crashes out, and the terminal doesn't exit cleanly, and then I lose those commands from my ...
1
vote
3answers
79 views

History command in graphic interface of OS

Does Ubuntu store a history of command executed in the graphic interface (not in a shell session)? For example if, by mouse, I click on System Settings, then click on Network, do these steps ...
2
votes
1answer
56 views

Entries in history

I usually include the password when I log in to MySQL. How do I exclude mysql -u root -pPassword being picked up and stored by history?
4
votes
2answers
12k views

How do I check if someone accessed my computer?

I need to check the list of files accessed in my computer (ex: yesterday on particular time). Is it possible? Or I need to check whether anybody accessed my computer (when I left it unlocked) or ...
3
votes
1answer
296 views

How to know the time of execution of previous commands [duplicate]

I know that using the history command I can view my past commands, but: Is there a way to view the date and time of the execution of those commands? Or is that kind of information not saved? And ...
0
votes
3answers
1k views

How to clear history on logout

I tried adding history -c to ~/.bash_logout but seems not working. Add: I'm having success by adding these lines into my ~/.bashrc (referred from here) unset HISTFILE export LESSHISTFILE=/dev/...