ubuntu/unix command line "history"

Tony Arnold tony.arnold at manchester.ac.uk
Tue Oct 16 16:09:02 UTC 2012


On 16/10/12 16:54, ping wrote:

> what happens? each terminal maintains a seperate instance of command
> line history? is there a method that I can always rely on to find out my
> old command?

By deafult when a shell exits, the history file gets over written
completely so you lose any history from previous shell invocations.

You can use 'shopt histappend' in your .bashrc file to cause the history
file to be appended to when a shell exits instead of being over written.

This is described in man bash under SHELL BUILTIN COMMANDS.

I think this will help.

Regards,
Tony.
-- 
Tony Arnold,                        Tel: +44 (0) 161 275 6093
Head of IT Security,                Fax: +44 (0) 705 344 3082
University of Manchester,           Mob: +44 (0) 773 330 0039
Manchester M13 9PL.                 Email: tony.arnold at manchester.ac.uk




More information about the ubuntu-users mailing list