What do the values in the prompt mean?


I know it is a very basic question. But I am struggling with this problem and I cannot solve it because of the lack of the basic understanding. After googling I didn't find any explanation. (Certainaly it is hidden somewhere in the documentation and one should read probably hundreds of pages to get there).

I'd appreciate your help. I really like to get knowing with Linux but first steps are somehow not easy.


The part before the "@"


is your username; check with

$ whoami

The part between "@" and ":"


is the hostname:

$ hostname

The part between ":" and "$"


is the current working directory, abbreviated to the tilde which is a synonym for your home directory:

$ pwd

And finally the "$" is the actual "prompt" sign, indicating you're a normal user (instead of root, in which case it would read "#"), and that command input is expected from you here.

Altogether this is a fairly vanilla shell prompt which is defined and assigned to the environment variable PS1 like this (without color codes for better readability), usually in the file ~/.bashrc:

PS1='\u@\h:\w\$ '

If you want to experiment with it, check out this page:



The prompt in the terminal is set by the variable PS1.

echo $PS1 shows how it is set in your system, and

man bash and search for the chapter on PROMPTING gets you the possible parameters for the PS prompts.

PS1 is set in .bashrc file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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