Save shell command history effectively September 18, 2005
Posted by Carthik in commands, guides, ubuntu.trackback
You should know as a beginning linux user that at the terminal you can press the up arrow to visit the previous commands that you have executed. The bash shell by default saves the last 500 commands (or fewer, if there aren’t that many to save), for easy recall.
However, by default, bash overwrites the history file when you close a session, or a terminal window, saving only those commands that were used in the last session. This can be annoying if, for example you have one terminal window open, and then you open another one, and close the new one after a few commands.
By adding the following line to ~/.bashrc , you can ask bash to append to the history file, thus preventing the overwriting:
shopt -s histappend
I find this pretty useful since I have discovered it.
You can find a detailed explanation of what I tried to say above, with pictures 😉 at the Power Shell Usage guide. You will also find a lot of other useful tips.
Thank you 🙂
As a linux noob, this could be useful.
This link was awesome!
very good yar thanx alot
also you can set how many you want to save, its no limit of 500
set history=1000 will save 1000
This is one of the most useful things I have learned about Ubuntu. Thank you very much.
insurance liability…
Donner:refugee suction …
Is there an equivalent for this in cshell? This is really handy… but I wish this worked in cshell too.
This link was awesome!