In addition, Pradas Sucesores, S.L. holds a permanent stock of more than XNUMX parts references for all types of shoe machines, some of which are produced in our factory as a result of our state-of-the-art technology. All we desire is to offer the shortest delivery times on the market and the best possible after-sales service to our customers.
history -c
… That simple 😀 LOL !!!
Nothing, is that I always start my posts giving a detailed explanation of the problem, to conclude with the solution, I thought about maybe changing a little 😀
On more than one occasion we have surely wanted to delete the history of commands that we have executed on our computer, for this I previously deleted the file .bash_history located in our home, but it is always better to use the tools or options that the system itself gives us ^ - ^
That is why I find the startup command perfect, a simple parameter (-c) tells the system to clear the command history.
Another method that should work too is:
echo "" > ~/.bash_history
This should put a blank line in our history deleting everything else :)
Well nothing, another tip that I hope you find interesting.
regards
LoL a super-useful and direct entry, thanks for the advice ^^
Thank you
I've been a little busy and a little unwilling to write these days, let's see if I write some things today and tomorrow ^ - ^
The second option had not occurred to me, interesting KZKG ^ Gaara 🙂
It occurred to me in fact writing the post HAHAHAHA, actually I deleted the .bash_history and already HAHAHA
You could still have done this:
cat /dev/null > ~/.bash_history
Or playing around a bit, maybe this:
rm ~/.bash_history && touch ~/.bash_history
In any case, I prefer to use history -d to specifically delete the things that annoy me, or to edit the file, close and start the session again.
Simple but useful!
Thanks!
Thanks to you for commenting ^ - ^
And deleting the content of the file with nano or vi and logging in again would not solve the problem?
Thank you here I found what I needed.
A greeting….
Excellent material. The time and dedication given is appreciated.
Thank you very much, right to the point!
Hello mate! Great your contribution, but I would make a small correction:
the complete command would be: echo ""> ~ / .bash_history && history -c
The problem is that the command "history -c" only clears the commands used in the open terminal, and on the other hand, when you do the "echo"> ~ / .bash_history "it cleans the file, but leaves you the last one written line, in this case, the clean command itself.
Therefore, the sum of both with && and in this order, allows you to leave what you want exactly, which is to clear the history of all terminal sessions (including the last one open)
I hope my contribution is helpful.
Hey.
Thanks for the command, but wouldn't it be more effective to use a secure erase (overwrite) to prevent the erased data from being recovered by third parties?
A greeting.
My dear Bartali, it all depends on what you hide. A simple erase is enough since the history of the terminal rarely contains sensitive data. Secure erase consumes additional resources and power. I use it only in the case of strictly private things or that could be used by cybercriminals.
I opened the file '/root/.bash_history' with the editor as 'root', and I deleted the content.
Sollocate history -c
good, none of the mentioned commands work for me.
the history -c if you clear the history, but when starting the terminal again, it loads everything.
someone knows how to delete the history permanently. ?
Thank you