Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Fun fact: if you don't want to put a command in history, prefix it with a space. This works in many shells.


This feature can also be be enabled in macOS by adding the following line to ~/.zshrc:

    setopt HIST_IGNORE_SPACE


> This feature can also be be enabled in macOS by adding the following line to ~/.zshrc:

> setopt HIST_IGNORE_SPACE

Except that I think it's called `histignorespace` (I haven't caught up with when and how much zsh cares about lowercased names), I think this is just about zsh, not about macOS specifically.


And if you're using fish shell, you can start a private session with fish --private or fish -P for short


Doesn't work for bash


You may need to enable it

HISTCONTROL=ignorespace




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: