Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 513  / 3 Years ago, mon, july 5, 2021, 7:59:48

I've got a problem with my Ubuntu 22.04. I want to clear out the command line history, so I type 'history -c' and everything seems fine, I type 'history' and it's all cleard. Then, I logout and shutdown, log in again and type 'history' once again and I'm back to square one with all my previous commands from the previous sessions.


I've already tried typing varieties of commands:


cat /dev/null > ~/.bash_history

cat /dev/null > ~/.bash_history && history -c && exit

echo > ./.bash_history

but nothing works. Thanks in advance, cheers


More From » 22.04

 Answers
4

Use history -c && history -w


From history --help:


Options:
-c clear the history list by deleting all of the entries

-w write the current history to the history file

[#392] Tuesday, July 6, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
feeous

Total Points: 102
Total Questions: 122
Total Answers: 119

Location: Netherlands
Member since Thu, Jul 1, 2021
3 Years ago
feeous questions
Sat, Jul 23, 22, 23:21, 2 Years ago
Mon, Aug 16, 21, 11:42, 3 Years ago
Sun, Mar 19, 23, 21:03, 1 Year ago
Wed, Dec 8, 21, 08:32, 2 Years ago
;