Difference between revisions of "Linux: Customize Shell Prompt"
Jump to navigation
Jump to search
Rafahsolis (talk | contribs) |
Rafahsolis (talk | contribs) |
||
| Line 12: | Line 12: | ||
http://ezprompt.net<br /> | http://ezprompt.net<br /> | ||
| − | + | https://wiki.archlinux.org/index.php/Bash/Prompt_customization#Colors<br /> | |
Examples: | Examples: | ||
<nowiki>PS1="\[\e[31m\][\[\e[m\]\[\e[31m\]\u\[\e[m\]@\[\e[31m\]\h\[\e[m\]\[\e[31m\]]\[\e[m\]:\[\e[36m\][\[\e[m\]\[\e[36m\]\w\[\e[m\]\[\e[36m\]]\[\e[m\]\[\e[31m\]\\$\[\e[m\] " | <nowiki>PS1="\[\e[31m\][\[\e[m\]\[\e[31m\]\u\[\e[m\]@\[\e[31m\]\h\[\e[m\]\[\e[31m\]]\[\e[m\]:\[\e[36m\][\[\e[m\]\[\e[36m\]\w\[\e[m\]\[\e[36m\]]\[\e[m\]\[\e[31m\]\\$\[\e[m\] " | ||
| − | export PS1="\[\e[33m\]\u\[\e[m\]@\[\e[31m\]\h\[\e[m\]:[\W]\\$ | + | export PS1="\[\e[33m\]\u\[\e[m\]@\[\e[31m\]\h\[\e[m\]:[\W]\\$ "</nowiki> |
Revision as of 23:13, 1 April 2017
Show current prompt string1
echo $PS1
- \u --> Username
- \h --> Hostname
- \w --> Current working Directory
- More info @man page bash
To modify edit ~/.bashrc
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
export PS1
http://ezprompt.net
https://wiki.archlinux.org/index.php/Bash/Prompt_customization#Colors
Examples:
PS1="\[\e[31m\][\[\e[m\]\[\e[31m\]\u\[\e[m\]@\[\e[31m\]\h\[\e[m\]\[\e[31m\]]\[\e[m\]:\[\e[36m\][\[\e[m\]\[\e[36m\]\w\[\e[m\]\[\e[36m\]]\[\e[m\]\[\e[31m\]\\$\[\e[m\] " export PS1="\[\e[33m\]\u\[\e[m\]@\[\e[31m\]\h\[\e[m\]:[\W]\\$ "