Bypassing Linux terminal history command tracking
The Linux history command is able to keep track of linux commands you have entered in the terminal. Whether you are using bash or zsh, you still have access to the history command.
Don’t be surprised when you log into a server and someone is able to get all the commands you entered in the terminal. The history command is one way to get all the commands.
The POWER of SPACE
To bypass the history tracking add space before any linux terminal command and history won’t track it. Eg:
ping google.com
docker ps
ls -lisa
whoami
sudo apt update
sudo apt upgrade
sudo apt install net-tools
After entering any linux command with space in front of the command, the command won’t be tracked in history. Check history again and nothing has been tracked.
You can edit the .bash_history
file and remove the commands our use history -c
command to clear everything in history tracking. But sometimes you don’t want to clear everything in the history.
Give it a try and thank me 👍.