Command history

From Linux Bash Shell Scripting Tutorial Wiki
Jump to navigation Jump to search

This article is a stub. You can help us by expanding it.

Command History acts as a repository of all the commands that you executed on CLI.

Sometimes it proves to be a blessing but at times it becomes a helpline to intruders. Use this feature while you are working on the terminal and clear it as soon as you finish.

man history

is the first command that can give you detail of the usage of this command. All the options which can be used with history command.

As a handy file you can always save your command history to an existing <filename>.txt file and clear the history.

<cat history > <filename>.txt(full path of this file e.g if the file exists on system desktop it will be like /root/Desktop/<filename>.txt)