To clear the entire contents of the history file, execute history -c. If you want to delete a particular command, enter history -d. There may come a time that you want to remove some or all the commands in your history file. In other words, this command is run: $ history | grep ssh Removing history The command is rerun, but with dnf replaced by ssh. For example, if I want to change my previous command history | grep dnf to history | grep ssh, I can execute the following at the prompt: $ ^dnf^ssh^ You can also use history to rerun a command with different syntax.
Now you can start typing a command, and matching commands will be displayed for you to execute by pressing Return or Enter. After typing this, the prompt changes to: (reverse-i-search)`':