Today I Learned: Hiding Commands in Linux History
Published on 12 Jul 2024
Use space before passing secrets on command line.
In the world of Linux, keeping your command history tidy and secure can be crucial, especially when dealing with sensitive information. Today I learned an invaluable trick: you can hide a command from your history simply by typing a space before it.
Why It Matters
When working with secrets, such as API keys, passwords, or confidential scripts, the last thing you want is to leave traces of these sensitive commands in your shell history. By using this technique, you ensure that these commands don’t get saved in the history file, reducing the risk of accidental exposure.
all tags
AI EV Existory ML TIL ai astronomy book-review bookmark bootcamp chi containers devops embedded frontend gaming gist git github golang homelab imagemagick internet javascript jekyll js k8s linux mental-model mgmt mysql opensource paper personal phenomenology prototyping psychology python review semiconductor social-media sprituality stateof sustainable til tools unix virtualization writing दर्शन