---
title: "Run incognito/private commands for Bash and Zsh"
description: "Simply put a space before the command and it won't be saved to ~/.bash\\_history. E.g.  qrencode -o out.png \"Some secret text\""
canonical: https://oozou.com/til/run-incognito-private-commands-for-bash-and-zsh-112
locale: en
date: 2020-12-08
topic: shell
---

# Run incognito/private commands for Bash and Zsh

> Simply put a space before the command and it won't be saved to ~/.bash\_history. E.g.  qrencode -o out.png "Some secret text"

Published: 2020-12-08 · Topic: [shell](https://oozou.com/til-topics/shell) ([markdown](https://oozou.com/til-topics/shell.md))

# Bash

Simply put a space before the command and it won't be saved to `~/.bash\_history`. E.g. ` qrencode -o out.png "Some secret text"`

# Zsh

Enable the following option to be able to run private commands by adding a space before and prevent it from being saved to `~/.zsh\_history`.

```
setopt HIST_IGNORE_SPACE
```

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
