[el7_blog]
/dev/urandom

history

Bash is configured to keep the last 1,000 commands you have used. When a shell session is closed, the historyof that session is updated to the history file .bash_history. The file .bash_history is created in the home directory of the user who started a specific shell session. The .bash_history file is closed only when the shell session is closed; until that moment, all commands in the history are kept in memory.

Working W/History:

  • Type history to show a list of all commands in the bash history.
  • Type Ctrl+r to open the prompt from which you can do a backward search in commands that you have previously used. Just type a part of the command you are looking for, and it will be displayed automatically. Type Ctrl+r again to search further backward based on the same search criteria.
  • Type !number to execute a command with a specific number from history.
  • Type !sometext to execute the last command that starts with sometext.
    * Notice: W/sometext the command that was found is executed immediately, executing it may be potentially dangerous.



Note:

  • history -c wipes all history that is currently in memory, but it doesn’t remove the .bash_history file from the home directory.

    * An alternative to deleting .bash_history is the command history -w after using history -c.