How to remove the device name from the bash prompt? Is it possible to remove the device name in my shell commands to "save space"?



My-MacBook-Pro:~ username$


to

~ username$
Yes, BASH (the default OS X Shell) has the ability to customize the prompt in many ways.

$PS1 is the the shell variable for the main prompt.

Try typing echo $PS1 in the command line and it will show you how $PS1 is currently configured.

If you just want to remove the the host name you can set $PS1 to \W \u\$ (note there is a space after the $) (i.e.$PS1="\W \u\$ ")

If you want this to happen every time you login in you will need to add export $PS1="\W \u\$ " to your .bashrc file.

There is extensive information on setting the PS1 prompt with other options in the man bash page.