tipsandtricks:others
Other tips and tricks
by Patrik Hermansson
Remove Terminal history
In Bash (the terminal) the commands are saved in the .bash_history file. If you write usernames and passwords in the terminal those are saved as commands in that file. In clear text! Password without echo (when you do not see the text) are not saved. Only the character that you see. To clear the file from entries, do the following. (needs to be done in all open windows (cli logins) if more than one SSH session is active/logged in)
history -c
history -w
The flag -c == clear the history list by deleting all entries. The flag -w == writes over the .bash_history file with the empty list thereby clearing it.
The commands you write in the active (open) window will be saved in memory and written in the file on exit/logout. You can see all commands in “memory” by using the command history without any flags.
tipsandtricks/others.txt · Last modified: 2023/09/29 07:01 by 127.0.0.1