How to Work with Bash History

Although there are many shells available for Fedora, RedHat and its clones, such as tcsh, ksh, sh and the like, up until now bash still remains the default shell of choice.  This does not come as a surprise because bash (which stands for Bourne Again Shell) has numerous lightning fast built-in commands that can manipulate and explore system on large and limited scales.

Many times I observed, that Linux sysadmin beginners remember remember well how to move among the commands by pressing up and down arrows. They also remember how to use Tab in the command line for completion. Yet, somehow they forget that a great bash command history will pull out the complete history list of commands that they used.

Naturally, getting to see the whole list of commands might not come handy. It is much better, for example,  to go back to the last 10 commands and type in the terminal history 10. This will do the trick.

There are so many other built-in bash history commands that it will take hefty hundred pages to describe them all. I just want to mention another useful history manipulation command that is called simply fc.  This one is very valuable becaue it allow you to open vi editor and run the command after editing it to your liking. For example, fc 356 will allow you to edit this command in vi and then immediately invoke it for you.

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

How to Share RedHat and Fedora Remote Directories with SSHFS

Next Post

Nirvanix + IBM + Cerner = Enterprise Cloud Storage Validated

Related Posts