I'm working in Mac OSX, so I guess I'm using bash...?
Sometimes I enter something that I don't want to be remembered in the history. How do I remove it?
If you want to run a command without saving it in history, prepend it with an extra space
For this to work you need either
To make this setting persistent, put it in your
If you've already run the command, and want to remove it from history, first use
to display the list of commands in your history. Find the number next to the one you want to delete and run
If you notice this immediately you can delete it from the unsaved history:
Use up-arrow to show the offending line then delete it using ctrl-w (or whatever the equivalent of ctrl is on a mac command-line)
Lines deleted this way will not be shown or saved to disk.
after you exit the shell it's too late for this method. you'll need to edit the history file using one of the other methods..