The list of all the commands that you have executed on your Mac Terminal is stored in the .zsh_history hidden file that you can find in your home directory.
% cat ~/.zsh_history
cd ~/Desktop
mkdir myrepo
cd myrepo
git init
mkdir module1
mkdir module2
cd module1
touch Sample.java
cd ..
cd module2
mkdir Main.java
clear
cd ..
git add .
git commit -m "init commit"
...
...
You can remove this file or open this file with vi/nano editor and clear all the text it has.
% rm ~/.zsh_history
You will need to close and reopen Terminal.
Now when you will run the history command you would not see your command history.
% history
1 history
2 rm ~/.zsh_history

Have Questions? Post them here!
- How to find path of file on Mac Terminal
- How to disable Siri on Mac Monterey
- [fix] macOS Ventura xcrun: error: invalid active developer path missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
- Select Line Number TextEdit on Mac
- Go to Specific file path using Mac Finder
- How to find Java HOME in Mac Terminal
- bash: command not found error [macOS Terminal Linux, Unix or Windows]
- Must Know Homebrew Commands for Mac/Linux Users
- How to Insert an Inverted Question Mark on Mac ¿
- Hide Keyboard Text Input Icon on macOS Ventura Menu Bar
- How to make macOS Terminal window Transparent (or Opaque)
- How to check of Updates on Microsoft Edge Browser on Mac (macOS)
- Limit scrollback rows in macOS Terminal
- How to identify installed Java (JDK) Version on macOS
- Keyboard Shortcut to delete a file on a Mac [Macbook]
- Open Docker from Terminal Command on Mac
- Installing MongoDB on Linux/Unix/macOS/Ubuntu
- How to take a screenshot on a Mac - updated for Ventura 13 [updated 2023]
- ls: .: Operation not permitted - Mac Terminal ZSH Error
- How to remove username from Mac Menu Bar?
- macOS Ventura XCode Command Line Tools Installation
- Where is .zshrc file located in macOS
- How to Show Path of Files or App in Mac Spotlight Search
- How to enable root user on Mac Terminal
- Install Java 17 (LTS) JDK on ARM based M1/M2 Mac Natively
- Center align text in TextView Android Programming - Android
- [Fix] brew: command not found Mac or Linux Terminal Error - MacOS
- Java JDBC Connection with PostgreSQL Driver Example - Java
- Shortcut: Move Cursor at the start or end of Line or file in Visual Studio Code (VS Code) - Shortcuts
- How to Install Compare Two Files Plugin in Notepad++ - NotepadPlusPlus
- Where are screenshots saved on Windows 11 using Snipping Tool? - Windows-11
- Java 8 Predicate Functional Interface Examples - Java
- Convert GMT/UTC timezone in Excel to EST, CST, MST, PST, AST and HST - Microsoft