+2 votes
in Operating Systems by (51.1k points)

I can see all the commands that I typed on the terminal using history command. How can I clear the history?

1 Answer

0 votes
by (40.7k points)

You need to clear the content of file '.bash_history' to clear the bash history. You can try one of the following approaches:

1.Run the following command on the terminal:

cat /dev/null > ~/.bash_history

2. Open '.bash_history' and manually delete everything from the file.

vi ~/.bash_history

and delete the content.