Keeping track of history of commands of multiple sessions of ksh
I am using multiple sessions of ksh on a linux machine. On one terminal when I do history, I only see history of commands typed on that terminal. When I log out all sessions, I want to make sure that history of commands typed on all the terminal get appended on one file say .bash_history. Is it possible?
Even when I don't log out, are all these commands dynamically get appended to this history file?
I am wary of losing my commands like when someone helps me do something, I want to make sure that I can refer to that command later on.
How do I set the size of .bash_history file
HISTSIZE will set the size of your history, default is 512; HISTFILE should be set to the name of your history file, default is ~/.sh_history.
I suppose you could set HISTFILE to ~/.bash_history, but that might be confusing later on.
From what I can see of the docs on ksh, it should be merging your history from multiple invocations. Try opening three separate sessions and issuing a distinct different command on each then logging out. Open a new instance of your term and view your history file - are they all there?
Tested out ok under ksh on Mac OS X