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
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to macOS,
- How to list all users in Mac Terminal
- Docker Desktop needs privileged access macOS
- Mac: How to show count of files and folders in Finder
- How to Change Background Color TextEdit on Mac
- How to adjust MacBook Desktop icons size
- Test internet speed using macOS Terminal command
- How to change the default font and text size in Microsoft Excel for Mac
- How to install Java on macOS [Big Sur]
- How to come out of dquote prompt in Terminal - macOS/Linux
- How to Increase MacBook Trackpad Cursor Speed on macOS Ventura/Sonoma
- Fix: Microsoft Excel Quit Unexpectedly on Mac
- How to Adjust macOS System Font Size
- How to Quit Applications on Mac Using Terminal
- How to check zsh installed version using terminal
- Two Ways to Extract rar (*.rar) files on Mac
- How to Right Click on Mac Desktop?
- How to Add Brew to PATH M1/M2 Mac
- How to search (find) in macOS Terminal Console Text
- macOS 13 Ventura - The New About this Mac Window
- TextEdit Get the count of lines in a file
- How to run .sh file in Mac Terminal
- Google Search Hot Trends Screensaver for Mac OS X
- Check Reboot History Mac
- [Solution] Mac Update Stuck Preparing macOS Ventura 13.0 About 30 minutes remaining
- Display Safari URL address link on hover
More Posts:
- [Fix] TypeError: str object is not callable in Python - Python
- WARNING: Python 2.7 is not recommended [macOS Big Sur] - MacOS
- How to update all installed packages at once in Ubuntu - Ubuntu
- Program 11: Calculate Percentage - 1000+ Python Programs - Python-Programs
- How to calculate SUM in Excel on Mac with Examples - Microsoft
- Have you noticed MacOS Ventura About this Mac look like Mac OS X - Mac-OS-X
- MacBook - Time Limit - You have reached your time limit, Ignore Limit - MacOS
- Remove AirDrop Icon from macOS Menu Bar - MacOS