Edit ~/.bashrc
Change bash(shell prompt) hostname and add a custom server name:
#export PS1='\h:\w\$ '
export PS1='my-server:\w\$ '
Add bash(shell prompt) time:
export PS1='[\t] my-server:\w\$ '
Apply changes:
Logout ( CTRL + D ) and login again.
Other available options:
\a ASCII bell char
\d current date
\e ASCII escape char
\n new line
\r carriage return
\s shell name
\@ current time 12H AM/PM
\V bash version + patch level
\! history number of this command
\# number of the command
\[ begin sequence nonprinting chars
\] end sequence nonprinting chars
Change bash(shell prompt) hostname and add a custom server name:
#export PS1='\h:\w\$ '
export PS1='my-server:\w\$ '
Add bash(shell prompt) time:
export PS1='[\t] my-server:\w\$ '
Apply changes:
Logout ( CTRL + D ) and login again.
Other available options:
\a ASCII bell char
\d current date
\e ASCII escape char
\h hostname (until first ".")
\H hostname\n new line
\r carriage return
\s shell name
\t current time 24H
\T current time 12H\@ current time 12H AM/PM
\u username
\v bash version\V bash version + patch level
\w current working directory
\W basename of the current directory\! history number of this command
\# number of the command
\$ "$" (if UID is not 0), "#" (if UID is 0)
\\ "\"\[ begin sequence nonprinting chars
\] end sequence nonprinting chars
No comments:
Post a Comment