How to View bash shell history and Change bash history file size in Ubuntu
View user bash history in Ubuntu
First open up a terminal from Applications > Accessories > Terminal and type the following command
This will show you all your terminal commands history on the terminal
If you want to save this history in to a file use the following command
history -w ~/userhistory.txt
Once you have save the file you can view using the following command from your terminal
Change bash history file size
If you want to change bash history file size open up your .bashrc using the following command from your terminal
Now add the following line at the top
Save and exit the file
As you can see, the limit can be changed.
Bash shell keeps it’s own history in a file. You can view that file as stated before, or by opening ~/.bash_history.
I think you have to do “
source ~/.bashrc” after that!
Good tip. I like to search thru history with ctrl-r inside bash – type a few chars and use ctrl-r again to cycle thru results.
You may want to give a try to https://github.com/dvorka/hstr that allows even more convenient shell history navigation and management.