Linux Bash History

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-bash-history/
PINTEREST
PINTEREST
INSTAGRAM
  1. Introduction To Linux Bash Programming
  2. Linux Bash Directories and Files
  3. Linux Bash Environment Variables
  4. Linux Bash Variables
  5. Linux Bash Functions
  6. Linux Bash If Else Conditionals
  7. Linux Bash Create and Run Script Files
  8. Linux Bash Operators
  9. Linux Bash Arrays
  10. Linux Bash Input, Output and Redirection
  11. Linux Bash History
  12. Linux Bash Alias
  13. Linux Bash .bashrc File
  14. Linux Bash Debugging

Bash shell runs in terminals like gnome-terminal, konsole, getty, etc. To make things make easy bash provides some shortcuts and pragmatic operations. Here we will look details about them.

History

Busy system administrators writes a lot of bash commands. They have no time to write notes about the commands. But bash have a history to assist. Bash history holds commands written before. This is very helpful when you write long and rarely used command and needed right now.

Listing History

I have cut the history is long as by default 1000 line. As you see bash lists all command we have issued.

Rerunning command

There is easy way to rerun previously issued command. As we see that history numbers commands. We will use these numbers to specify command like below.

We use !3 to rerun number 3 history command. As we see that rerunning command echoes issued command which is ls

Searching History

History provides a lot of commands. And finding a specific command in list may become hard. There is easy way to filter commands.

LEARN MORE  Linux Print History Command Without Line Numbers

We get help from grep command. It filters commands that provides ls and list them.

Clearing History

Some times we need to clear things we have done. For example if we provided a command with clear text password we may want to clear these commands.

Getting History Size

History is very helpful but if we are hardworking system administrator the size of the is may become small for us. By default history size is 1000 which means the last 1000 commands will be hold.

History size is hold as bash environment variable. By changing HISTSIZE environment variable the size may increased.

Setting History Size

History is very helpful but if we are hardworking system administrator the size of the is may become small for us. By default history size is 1000 which means the last 1000 commands will be hold.

History size is hold as a bash environment variable. By changing HISTSIZE  environment variable the size may increase.

  1. Introduction To Linux Bash Programming
  2. Linux Bash Directories and Files
  3. Linux Bash Environment Variables
  4. Linux Bash Variables
  5. Linux Bash Functions
  6. Linux Bash If Else Conditionals
  7. Linux Bash Create and Run Script Files
  8. Linux Bash Operators
  9. Linux Bash Arrays
  10. Linux Bash Input, Output and Redirection
  11. Linux Bash History
  12. Linux Bash Alias
  13. Linux Bash .bashrc File
  14. Linux Bash Debugging
RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-bash-history/
PINTEREST
PINTEREST
INSTAGRAM

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)