How to Hide Commands from History in Terminal

preview_player
Показать описание
#CreatingForIndia

Join this channel to get access to perks:

Keywords:
Amazon
AWS
Amazon Web Services
Best AWS tutorials
Aws in hindi
aws tutorials
aws services
Рекомендации по теме
Комментарии
Автор

This is a useful trick to keep sensitive information, like passwords or API keys, from being stored in the history.

Here's how it works:

- When you enter a command normally, it gets saved in the `~/.bash_history` file (or equivalent for your shell).
- But when you add a space at the beginning of the command, Bash (or your shell) ignores it and doesn't save it in the history file.

This trick only works for the current shell session. If you close the terminal or log out, the history is still saved. To permanently exclude commands from history, you can use the `HISTIGNORE` environment variable or modify your shell configuration.

shizagull