If you wish to find what commands you have previously executed in a Linux environment you can use the history command. In addition to that, you can also look in the file ~/.bash_history if you’re using bash. In this article we’ll cover the most basic usages of the Linux history command:
Display the last commands run with Linux history command
history
Clear your command history
history -c
Search for a command with history and grep
history | grep {Command to look for}