2

I have found myself to grow fond to CentOS's command prompt which looks like the following:

 [user@host directory]$ cmd 

I, personally, do not like how Mac OS X Terminal is laid out, which is:

 host:directory user$ cmd 

Is there any way to change the prompt of Terminal's commands to make it look more like the first one? I am very new to these things.

1 Answer 1

7

If you are using bash, simply do PS1='[\u@\h \w]$ '

More details and options in man bash (search for PROMPTING)

If tcsh, do man tcsh and search for "prompt"

1
  • 1
    Also, I had to use \W instead of \w, because CentOS shows just the directory name, not the path. Commented Jul 2, 2013 at 4:27

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.