By default the prompt that you see on your Mac Terminal is as,
Syntax:logged-in-username@Mac-device-name Current-Directory %
Example:
c2cdev@C2cs-MacBook-Pro Desktop %
If you want to change the way the prompt looks, you can do that by adding the PROMPT details in the .zshrc file.
Steps to Change macOS Terminal Prompt:
- Open Terminal App
- Type zsh and press enter to make sure to are in the ZSH Shell.
- Now type nano ~/.zshrc to open this fine in Nano text editor.
- Add the below line line in the file and save and exit.
PROMPT="macOS %% "Now Press Control + X followed by Y and Enter.
- To apply changes type source ~/.zshrc on the prompt and enter
- You will see that the prompt has changed to macOS %


This is not an AI-generated article but is demonstrated by a human on an M1 Mac running macOS Sonoma 14.0.
Please support independent contributors like Code2care by donating a coffee.
Buy me a coffee!

Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!