PS1

noun

say it: “PEE ESS WUN” /ˌpiˌɛs ˈwʌn/

The shell variable bash draws its prompt from; codes in it stand for things such as your user name and the folder you are in.

What is PS1?

PS1 (read "P S one", the first prompt string) is the variable bash draws its prompt from. Codes in it are filled in each time: \u is your user name, \w the whole path of the folder you're in, \W only its last name, \A the time and \$ a $ (or # for root). Set it in ~/.bashrc to keep it.

PS1='\W \$ '        # the prompt becomes: shortcuts $

In a sentence

  • “Sam set PS1 to show only the folder's name, so his prompt shrank to shortcuts $.”
  • “A color code in PS1 made the folder name bold cyan.”

Level: Journeyman · More Unix terms at this level

Updated