Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email 



BASH HISTORY


As we are doing more and more commands at the bash-prompt it's time to learn a neat little trick:

As you are at an empty prompt press the "arrow-up" key and you will see the previous command you typed in !
Press again, and again, and again, see all the commands that were stored in the "bash-history"

As current user you will only see the commands you typed in, as root you will see the commands you typed in as root.

More fun, type in:

CODE
$ history

And you'll get a full numbered list of all stored commands

CODE
$ !8

Will get you number 8 of that list

CODE
$ !v

And you will get the last command that started with v


Ctrl+R will let you do a search in the history


Bash history won't be lost at reboot or shutdown, clever isn't it ?


Bruno


-- Dec 9 2003 ( Revised Dec 9 2005 ) --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email