Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Right now in my MacOS X terminal I have MyComputer:~ me$ before all the commands.

In some videos I saw they have just $ - that's much less clutter, how is it done?

share|improve this question
up vote 7 down vote accepted

This text is printed by your shell, and it's called a prompt.

Your shell is probably bash. The prompt is set in bash's initialisation file, which is .bashrc in your home directory. Specifically, the prompt is set by the PS1 variable. Its value can contain escape sequences that are replaced by some value when the prompt is displayed. For example, MyComputer:~ me$ results from a prompt setting like

PS1='\h:\w \u\$ '  # host name colon working directory space user name dollar space

Try adding the following line at the end of your .bashrc (create it if it doesn't exist):

PS1='\$ '

If this doesn't change anything, it's because you have a login shell and no proper .bash_profile. See Difference between .bashrc and .bash_profile for an explanation. Short story: create a .bash_profile containing

if [ -r ~/.profile ]; then . ~/.profile; fi
case "$-" in *i*) if [ -r ~/.bashrc ]; then . ~/.bashrc; fi;; esac
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.