change bash prompt
# syntax:
# export PS1='<Format required>'
# example:
export PS1='\[\033[1;33m\]\u@\[\e[0;36m\]\h:\[\e[1;32m\]$(pwd)\[\e[1;32m\]> \[\033[1;37m\]'
#===========================================================================================
# + ----------- + ----------------------------------------------------------- +
# | USABLE CODE | WHAT THE CODE REPRESENTS |
# + ----------- + ----------------------------------------------------------- +
# | \u | username |
# | \h | hostname |
# | \w | Full path of the current working directory (uses ~) |
# | $(pwd) | Full path of the current working directory (doesn't use ~) |
# | \[ | Begin sequence of non-printing characters |
# | \] | End sequence of non-printing characters |
# + ----------- + ----------------------------------------------------------- +
# + -------- + ------------ +
# | CODE | COLOR |
# + -------- + ------------ +
# | \e[0;30m | Black |
# | \e[1;37m | White |
# | \e[0;31m | Dark Red |
# | \e[1;31m | Light Red |
# | \e[0;32m | Dark Green |
# | \e[1;32m | Light Green |
# | \e[0;33m | Dark Yellow |
# | \e[1;33m | Light Yellow |
# | \e[0;34m | Dark Blue |
# | \e[1;34m | Light Blue |
# | \e[0;35m | Dark Pink |
# | \e[1;35m | Light Pink |
# | \e[0;36m | Dark Cyan |
# | \e[1;36m | Light Cyan |
# | \e[0;37m | Dark Gray |
# | \e[1;30m | Light Gray |
# + -------- + ------------ +
0
4
PS1="\w> "
Thank you!
4
0
Are there any code examples left?
New code examples in category Shell/Bash
-
Shell/Bash 2022-03-27 22:30:33 wise highlight ubuntu
-
Shell/Bash 2022-03-27 22:25:19 how to send a pull request in git
-
Shell/Bash 2022-03-27 21:55:06 how to open terminal in sublime text ubuntu
-
Shell/Bash 2022-03-27 21:25:19 how to switch branch
-
Shell/Bash 2022-03-27 21:20:25 python
-
Shell/Bash 2022-03-27 21:20:04 set user as admin gitlab
-
Shell/Bash 2022-03-27 21:10:09 apache2 mod_jk proxy to tomcat connector
-
Shell/Bash 2022-03-27 20:35:12 chown
-
Shell/Bash 2022-03-27 20:15:08 awk last match