Currently in my Terminal, every shell prompt looks like ComputerName: FooDir UserName$
. The UserName
part simply wastes too much space out of my precio
2019 onwards, MacOS default shell is Z Shell. To customize command prompt, add a file named .zshrc
in user home and put following line that sets a PS1
environment variable with desired prompt format:
export PS1="[%n]%~> "
Open new terminal
This is result of following format expansion:
%n
User name%~
Current directorySee full list of available expansions here.