You are not logged in.
Pages: 1
Hello Community,
how can I clear the History from Terminal ?
Offline
rm ~/.ash_history
Offline
You can create a script:
[c]#!/bin/sh
rm ~/.ash_history
touch ~/.ash_history
exit[/c]
Save as: clear-history
Give permission: chmod +x clear-history
And put it in: ~/.local/bin
To run the script: clear-history
...
Offline
> ~/.ash_history
..should be sufficient..
Offline
Hello,
If I delete the file .ash_history (in /home/username/), the history as 'user' is cleared, that's OK.
But when I go root (su in terminal), I continue to see another history (history as root). Where/how can I delete history as root?
Thank you
Offline
As root repeat same command
> ~/.ash_history
or
> /root/.ash_history
Offline
OK, thank you.
To resume, to clear the history as user + root, I deleted 2 files :
/home/username/.ash_history
/root/.ash_history
Offline
Pages: 1
[ Generated in 0.017 seconds, 7 queries executed - Memory usage: 1.53 MiB (Peak: 1.77 MiB) ]