Take the 2-minute tour ×
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.

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

1 Answer 1

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

 
discard

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.