Skip to main content
5 of 5
deleted 101 characters in body; edited title
tshepang
  • 67.7k
  • 94
  • 226
  • 297

Is there any way to keep a command from being added to your history?

Is there any way to keep a command from being added to your history? I have a command that I want to keep out of my history file, and I really don't care to have it there when I search the history stored in memory, though that's less of a concern. Is there any way to prevent this, or do I just have to go back and edit my history file.

update: I didn't realize this might be shell-specific. My shell is zsh. You're welcome to answer for other shells so people know how to do this in their shell.

xenoterracide
  • 61.5k
  • 79
  • 196
  • 252