I randomly found that with extra space at the beginning of command, bash shell do not record its history. nickfarrow :dev$ echo "Test history" #space at beginning Test history nickfarrow :dev$ echo "test history #2" test history #2 nickfarrow :dev$ echo "test history #3" test history #3 $ history => only show first command without extra space 2215 echo "Test history" And when use UP key ↑, it only show command without extra space. I am using Ubuntu 18 (VirtualBox) nickfarrow :dev$ uname -a Linux nickfarrow-VirtualBox 5.4.0-120-generic #136~18.04.1-Ubuntu SMP Fri Jun 10 18:00:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Some tribes of the programmer clan.