As we know, press up arrow key can show history commands,but i found that when a command which starting with space will not show in "up arrow"'s history:
$ls
$(press up arrow key)
bash will show:
$ls
however:
$ps
$ ls(notice this command starts with a space)
now i press up arrow key,it will show 'ps' but not 'ls':
$ps
Is this a bug in bash or a specific feature?:)
From bash(1)
:
HISTCONTROL
A colon-separated list of values controlling how
commands are saved on the history list. If the list
of values includes ignorespace, lines which begin with
a space character are not saved in the history list.
It's an intentional feature to let you prevent commands with passwords or other private data from being saved to disk. (It won't keep it out of the ps(1)
process listing.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With