I am using the command line on the ESX console. I have a certain command I use that needs a password passed with the command. I want to make sure this is gone when I am done with it. If I push the up arrow I can cycle through the commands and find the previously entered command with the password in it. how can I clear this command without logging out?
I guess this is more of a general unix question, but was hoping it was an easy one for the linux gurus on this site.
Thanks.
history -c should do the job for you.
Is there a man page for history command?
history -c should do the job for you.
Thanks, that worked.
FYI, logging out doesn't seem to clear the previous commands, so the history -c command seems rather important. I logged out of a SSH session and when I logged back in, I could still cycle to my old commands. This included the command with my password! using the history -c command clears it permanently
You can also try the following to disabled history completely. Edit /etc/profile
and change
HISTSIZE=1000 to HISTSIZE=0
and add
unset HISTFILE
The 2nd change will disable the history file (/root/.bash_history for the root user) and the 1st change will disable history within a session itself.