Quantcast
Channel: How to delete history of last 10 commands in shell? - Stack Overflow
Viewing all articles
Browse latest Browse all 23

Answer by M. Gleria for How to delete history of last 10 commands in shell?

$
0
0

I used a combination of solutions shared in this thread to erase the trace in commands history.First, I verified where is saved commands history with:

echo $HISTFILE

I edited the history with:

vi <pathToFile>

After that, I flush current session history buffer with:

history -r && exit

Next time you enter to this session, the last command that you will see on command history is the last that you left on pathToFile.


Viewing all articles
Browse latest Browse all 23

Trending Articles