Difference between revisions of "Changing bash prompt"

From Linux Shell Scripting Tutorial - A Beginner's handbook
Jump to navigation Jump to search
Line 2: Line 2:
 
|previous=Using aliases
 
|previous=Using aliases
 
|next=Setting shell options}}
 
|next=Setting shell options}}
 +
* Task: You need to customize your bash prompt by editing PS1 variable.
 +
* Display, your current prompt setting, enter:
 +
<source lang="bash">echo $PS1</source>
 +
Sample outputs:
 +
<pre>\u@\h:\w\$</pre>
  
{{Stub}}
 
  
 
[[Category:Variables and Quoting]][[Category:Commands]]
 
[[Category:Variables and Quoting]][[Category:Commands]]

Revision as of 10:52, 20 October 2009

← Using aliasesHomeSetting shell options →

  • Task: You need to customize your bash prompt by editing PS1 variable.
  • Display, your current prompt setting, enter:
echo $PS1

Sample outputs:

\u@\h:\w\$

← Using aliasesHomeSetting shell options →