|
|
|
|
|
by capableweb
1319 days ago
|
|
Pro-tip: if you wanna hide stuff from your shell history, enter a space/blank before the actual command. Not that it probably would have helped in this situation, but maybe useful for others. Usually if I have to enter secrets in my shell, I do something like this in order to save the useful stuff to history but hiding the secrets: - ` export PASSWORD=hunter2` (notice the space before "export") - `service-cli login username $PASSWORD` (no space before, gets saved to shell history) |
|
HISTCONTROL=ignorespace # bash
setopt hist_ignore_space # zsh
These go into ~/.bashrc or ~/.zshrc, respectively. zsh is really smart about this and always enables you to retrieve the immediate previous line with arrow-up, no matter whether it's got preceding whitespace or not.