I am moving from one server to another, but want to keep my history, so I dumped it into a file.
history > file.txt
Is there a way to overwrite the commands-history of bash and load it from a file?
I am moving from one server to another, but want to keep my history, so I dumped it into a file.
history > file.txt
Is there a way to overwrite the commands-history of bash and load it from a file?
The following will append the contents of file.txt
to the current in-memory history list:
history -r file.txt
You can optionally run history -c
before this to clear the in-memory history.
You can try to edit this file and paste everything in there:
emacs -nw ~/.bash_history
Here's an interesting post about the command-history: http://www.ducea.com/2006/05/15/linux-tips-take-control-of-your-bash_history/