---
title: "รันคำสั่งแบบ incognito/ส่วนตัวสำหรับ Bash และ Zsh"
description: "แค่ใส่ space ไว้หน้าคำสั่ง คำสั่งนั้นก็จะไม่ถูกบันทึกลง ~/.bash\\_history เช่น  qrencode -o out.png \"Some secret text\""
canonical: https://oozou.com/til/run-incognito-private-commands-for-bash-and-zsh-112
locale: th
date: 2020-12-08
topic: shell
---

# รันคำสั่งแบบ incognito/ส่วนตัวสำหรับ Bash และ Zsh

> แค่ใส่ space ไว้หน้าคำสั่ง คำสั่งนั้นก็จะไม่ถูกบันทึกลง ~/.bash\_history เช่น  qrencode -o out.png "Some secret text"

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

# Bash

แค่ใส่ space ไว้หน้าคำสั่ง คำสั่งนั้นก็จะไม่ถูกบันทึกลง `~/.bash\_history` เช่น ` qrencode -o out.png "Some secret text"`

# Zsh

เปิดใช้งานตัวเลือกต่อไปนี้เพื่อให้รันคำสั่งส่วนตัวได้ด้วยการใส่ space ไว้ข้างหน้า และป้องกันไม่ให้คำสั่งถูกบันทึกลง `~/.zsh\_history`

```
setopt HIST_IGNORE_SPACE
```

---

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

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