Customized PS1 Prompt

Find your way to the Linux operating system

We all know it and we all want to customize it right ^^, our very own customized PS1 prompt, well here is some info on how to do that.

Example of a simple PS1 prompt:

marc@server:~/$

This is like the most default prompts when you install Linux, some may look a bit different but most likely nothing more.
To Customize the PS1, you need to know what to change and what to use, here is a list with some info about the letters used in PS1.

d - the date in "Weekday Month Date" format (e.g., "Tue May 26")
e - an ASCII escape character (033)
h - the hostname up to the first .
H - the full hostname
j - the number of jobs currently run in background
l - the basename of the shells terminal device name
n - newline
r - carriage return
s - the name of the shell, the basename of $0
t - the current time in 24-hour HH:MM:SS format
T - the current time in 12-hour HH:MM:SS format
@ - the current time in 12-hour am/pm format
A - the current time in 24-hour HH:MM format
u - the username of the current user
v - the version of bash (e.g., 4.00)
V - the release of bash, version + patch level (e.g., 4.00.0)
w - Complete path of current working directory
W - the basename of the current working directory
! - the history number of this command
# - the command number of this command
$ - if the effective UID is 0, a #, otherwise a $
nnn - the character corresponding to the octal number nnn
\ - a backslash
[ - begin a sequence of non-printing characters, which could be
used to embed a terminal control sequence into the prompt
] - end a sequence of non-printing characters

So for example, you could do something like this:

export PS1="\e[0;34m\u@\h \w> \e[m"

This will give you a full lightblue PS1 prompt.

To add more colors try (put this one in your ~/.bashrc file)

PS1='\[\033[38;5;141m\][\[$(tput bold)\033[1;34m\]\u\[\033[01;36m\]@\[\033[01;37m\]\h\[\033[00m\]:\[\033[38;5;39m\]\w\[\033[38;5;141m\]]\[\033[1;37m\]\$\[\033[00m\] '

This will look like:

Now i know what you think, you just want a great PS1, this is possible due to some guys who created a few online bashrc generators.

I always use this one:
Bashrc Generator
Easy to use and highly customizable.