If you work in the Terminal like I do, you’d like to see some customizations done to personalize it.  This tip will show you how to customize the Terminal prompt.

The Terminal prompt is shown just before where you type in the commands to execute commands.  Sometimes, users like to personalize this prompt for one reason or another.

Here’s how:

  1. Open Terminal (Finder > ApplicationsUtilities > Terminal).
  2. First, ensure you’re in the HOME Directory by issuing the command: cd ~/
  3. To prove you’re in the right directory and show hidden files, type in: ls-la
  4. Check and see if a file named bash_profile exists.
  5. If it doesn’t exist, create one by typing in: touch .bash_profile
  6. You’ll have to edit this file by typing: open -e .bash_profile
  7. Add this line to the file and save it: export PS1=”u$ “
  8. Quit Terminal and relaunch it in step #1 to see your new prompt.
  9. That’s it.

In addition:

Here’s an abbreviated list of commands that can change the prompt:

  • \d – Current date
  • \t – Current time
  • \h – Host name
  • \# – Command number
  • \u – User name
  • \W – Current working directory (ie: Desktop/)
  • \w – Current working directory with full path (ie: /Users/Admin/Desktop/)

There are other things you can do to customize the prompt, like using Emojis, colors, and more.  You can do a search via Google or DuckDuckGo for more information.

About Post Author

(Visited 147 times, 1 visits today)


Advertisement
Dan Uff
Senior Writer / Owner
https://www.compuscoop.com/