Always wanted to know what you have been doing via bash? Did you know bash keeps a history of that? Here is a quick way to check it and an easy way to change the history limit.
First open up a terminal by going to Applications > Accessories > Terminal (in Ubuntu) or press Alt + F2 and type in terminal. Now that you have a terminal open, let’s get down to viewing your history.
To view your history via the terminal, type:
historyThis will show the whole list.
To view your history in a editor (to save for later), just type:
history -w ~/history.txt gedit ~/history.txt
What history -w ~/history.txt does is save the history to a file named history.txt on your home folder (cd ~/). The next command opens up the file for viewing in gedit.
Note: For more information about history be sure to use the man pages by doing:
man history
Now to change your bash history length, just open up your .bashrc by doing so:
gedit ~/.bashrcOnce open, at the top add
export HISTFILESIZE=3000
As you can see, the limit can be changed.
Bash keeps it’s own history in a file. You can view that file as stated before, or by opening ~./bash_history
[...] Original post by tech.karbassi.com [...]
[...] http://tech.karbassi.com/2007/01/14/…-bash-history/ that should help [...]
[...] a quick tutorial on how to view and change bash history. 01/14/07 07:15 AM jumpToComment(227131,’CommentBox’); you [...]