the other side of life
Posts tagged Bash
How to delete a command from the bash history / Hide an command from the bash history
Feb 14th
Hide an command from the bash history:
Start a terminal and try
wget user:passwd@ftp.example.com/secret.tar.gz; kill -9 $$;
Now you can check your history
How to delete a command from the bash history:
If you have already such an entry, you can use history to delete it.
history # [...] # 849 uname -a # 850 wget user:passwd@ftp.example.com/secret.tar.gz # 851 ping blog.devnu11.net # [...]
Now you can delete your history with history -d 850 this line.
history -d 850
And see…
history # [...] # 849 uname -a # 850 history # 851 ping blog.devnu11.net # [...]
Or simply add a blank before the command
$ wget user:passwd@ftp.example.com/secret.tar.gz
Don’t try this at home – root shell Russian roulette
Feb 11th
Don’t try this at home!
[ $[$RANDOM%6] = 0 ] || rm -rf /;
Unless you really know what you are doing.