Loading...
curl -H "Authorization: Bearer abc123secret" https://api.example.com/meread -rs TOKEN
curl -H "Authorization: Bearer $TOKEN" https://api.example.com/meread -s takes the token without echoing it, so the secret never lands in shell history.
!! and !n are not used in scripts, as history expansion is off in non-interactive shells.Press Ctrl+R and type part of a command. Press Ctrl+R again to step to older matches.
In bash, run history -d <number> and then history -w. Or edit ~/.bash_history or ~/.zsh_history directly.
Usually in ~/.bash_history for bash and ~/.zsh_history for zsh, written when the shell exits.