Changing Bash Prompt

Change your prompt using the command :
$ export PS1="[\u@\h \w]# "

Various Options that can be used are:

\a The ASCII bell character (you can also type \007)
\d Date in “Sat Sep 04″ format
\e ASCII escape character (you can also type \033)
\h First part of hostname (such as “mybox”)
\H Full hostname (such as “mybox.mydomain.com”)
\j The number of processes you’ve suspended in this shell by hitting ^Z
\l The name of the shell’s terminal device (such as “ttyp4″)
\n Newline
\r Carriage return
\s The name of the shell executable (such as “bash”)
\t Time in 24-hour format (such as “23:59:59″)
\T Time in 12-hour format (such as “11:59:59″)
\@ Time in 12-hour format with am/pm
\u Your username
\v Version of bash (such as 2.04)
\V Bash version, including patchlevel
\w Current working directory (such as “/home/koithara”)
\W The “basename” of the current working directory (such as “koithara”)
\! Current command’s position in the history buffer
\# Command number (this will count up at each prompt, as long as you type something)
\$ If you are not root, inserts a “$”; if you are root, you get a “#”
\xxx Inserts an ASCII character based on three-digit number xxx (replace unused digits with zeros, such as “\007″)
\\ A backslash
\[ This sequence should appear before a sequence of characters that don’t move the cursor (like color escape sequences). This allows bash to calculate word wrapping correctly.
\] This sequence should appear after a sequence of non-printing characters.

Adding color to your Prompt :
$ export PS1="[\e[32;31m\u@\h \w ]# "

Making your Setting Permanent
* Add the export command to your $HOME/.bashrc

15 Comments »

  1. Vi Said,

    September 19, 2011 @ 10:54 am

    ….

    Best place to buy Viagra ►►►

  2. Jorge Said,

    August 22, 2014 @ 5:55 pm

    < a href = “http://org.agelyrics.ru/?p=14&lol= usable@eulogized.assistants”>.< / a >…

    good!…

  3. gene Said,

    August 22, 2014 @ 6:01 pm

    < a href = “http://fr.oldiesmusic.ru/?p=37&lol= playhouse@helmut.beebes”>.< / a >…

    hello!!…

  4. angelo Said,

    August 23, 2014 @ 7:50 am

    < a href = “http://gov.albumtect.ru/?p=5&lol= riches@remind.replication”>.< / a >…

    good info….

  5. Kenneth Said,

    August 23, 2014 @ 2:55 pm

    < a href = “http://ru.artistguild.ru/?p=17&lol= chernishev@misdirectors.isomers”>.< / a >…

    thank you….

  6. luke Said,

    August 23, 2014 @ 9:20 pm

    < a href = “http://cn.albumcore.ru/?p=20&lol= unsinkable@physics.required”>.< / a >…

    good info!!…

  7. jeffery Said,

    August 24, 2014 @ 1:21 am

    < a href = “http://fr.albumency.ru/?p=48&lol= synce@angell.walle”>.< / a >…

    tnx!!…

  8. ruben Said,

    August 24, 2014 @ 3:40 am

    < a href = “http://eu.songshelf.ru/?p=17&lol= declines@harro.cubed”>.< / a >…

    thanks!…

  9. Andre Said,

    August 24, 2014 @ 10:29 am

    < a href = “http://gov.mp3work.ru/?p=2&lol= mea@holabird.hormone”>.< / a >…

    good!…

  10. Dana Said,

    August 24, 2014 @ 10:59 am

    < a href = “http://uk.albumorbit.ru/?p=30&lol= businesses@mania.tenors”>.< / a >…

    спс!!…

  11. Jesse Said,

    August 24, 2014 @ 11:55 am

    < a href = “http://net.mp3ovator.ru/?p=27&lol= droppings@fulton.vertebrae”>.< / a >…

    thanks for information!…

  12. marion Said,

    August 24, 2014 @ 12:47 pm

    < a href = “http://ch.artistcat.ru/?p=4&lol= sheds@uglier.sets”>.< / a >…

    good!!…

  13. michael Said,

    August 26, 2014 @ 6:21 am

    < a href = “http://catalog.mp3miller.ru/?p=8&lol= fearlessly@schillinger.watercolorist”>.< / a >…

    good info!…

  14. Cecil Said,

    August 26, 2014 @ 10:02 am

    < a href = “http://eu.albumtory.ru/?p=33&lol= varityping@radiate.yachtels”>.< / a >…

    hello!…

  15. alex Said,

    August 26, 2014 @ 3:13 pm

    < a href = “http://org.songseller.ru/?p=34&lol= instead@heterogeneous.otto”>.< / a >…

    thanks for information!…

RSS feed for comments on this post · TrackBack URI

Leave a Comment