Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
bash:tip_customize_the_shell_prompt [2011/06/22 11:48]
flozz [Special sequences]
bash:tip_customize_the_shell_prompt [2017/09/01 12:24] (current)
Line 1: Line 1:
 ====== Bash tips: Customize the shell prompt ====== ====== Bash tips: Customize the shell prompt ======
  
-FIXME+The prompt of Bash can be customized, and can displays several useful informations.
  
 +The main prompt is stored in the ''​PS1''​ variable of the shell. You can show it with the following command:
 +<code bash>​echo $PS1</​code>​
  
 +and you can change it by modifying the content of this variable. For example this command will change your prompt:
 +<code bash>​PS1="​This is my new prompt >>>​ "</​code>​
  
 +If you close your terminal and open it again, the prompt is reverted to the default ; that is normal because you have not
 +save it. For permanently changing you prompt, you have to modify your ''​~/​.bashrc''​ file. The simple way to change your
 +prompt is to add the following line at the end of the file:
 +<code bash>​PS1="​Prompt >>>​ "</​code>​
 +
 +Now let's see the different things that can be displayed in the prompt...
 ===== Prompt Helper ===== ===== Prompt Helper =====
  
 
bash/tip_customize_the_shell_prompt.txt · Last modified: 2017/09/01 12:24 (external edit)