How to avoid a command to be logged in bash's history

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

How to avoid a command to be logged in bash's history

Post by ^rooker »

Accidentially, I just stumbled over an interesting behavior of bash:

When a command starts with a "space" character (0x20), it does not show up in bash's history when you do a "cursor up" or "Ctrl+R" search.
I haven't yet verified if it's also not written to .bash_history, but we'll see...


Anyways, I'm posting this because I think it might be handy sometimes to issue commands and not have them logged ;)
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply