Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-28-2006, 09:21 PM   #1
Registered: Jan 2005
Location: india
Distribution: slackware 10.0 (kernel 2.4.26)
Posts: 104

Rep: Reputation: 15
shell customization

hi all...

i m using slackware 10.0.
My shell prompt shows 'bash-2.05' .
Earlier it shows 'root@/mnt/.....' ie user@path of directory i m working in.
how can i change it back to it...

thanks in advance
Old 03-28-2006, 09:31 PM   #2
Registered: Mar 2003
Location: St. Louis, MO
Distribution: kubuntu-current
Posts: 551
Blog Entries: 4

Rep: Reputation: 31
Here is a copy and paste of something I've kept for reference:
Editing your bash prompt can be deep, fun and sometimes pretty!!
have fun!


Below you will find a complete list of all special sequences,
and color codes.

Sequence Description
\a The ASCII bell character (you can also type \007)
\d Date in "Wed Sep 06" format
\e ASCII escape character (you can also type \033)
\h First part of hostname (such as "mybox")
\H Full hostname (such as "")
\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:01:01")
\T Time in 12-hour format (such as "11:01:01")
\@ 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/drobbins")
\W The "basename" of the current working directory (such as "drobbins")
\! 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.

Black 0;30 Dark Gray 1;30
Blue 0;34 Light Blue 1;34
Green 0;32 Light Green 1;32
Cyan 0;36 Light Cyan 1;36
Red 0;31 Light Red 1;31
Purple 0;35 Light Purple 1;35
Brown 0;33 Yellow 1;33
Light Gray 0;37 White 1;37

Foreground colors:
0;30 Black
0;31 Red
0;32 Green
0;33 Yellow\Orange
0;34 Blue
0;35 Magenta
0;36 Cyan
0;37 Light Gray\Black
0;39 Default
NC='\e[0m' # No Color

Bright foreground colors:
1;30 Dark Gray
1;31 Red
1;32 Green
1;33 Yellow
1;34 Blue
1;35 Magenta
1;36 Cyan
1;37 White
0;39 Default

\e[m\]Background colors:
\[\e[1;37m\e[40m40: Black\e[0;49m\n\
\e[41m41: Red\e[0;49m\n\
\e[42m42: Green\e[0;49m\n\
\e[43m43: Yellow\Orange\e[0;49m\n\
\e[44m44: Blue\e[0;49m\n\
\e[45m45: Magenta\e[0;49m\n\
\e[46m46: Cyan\e[0;49m\n\
\e[47m47: Light Gray\Black\e[0;49m\n\
\e[49m49: Default\e[m\]\n'


If anyone read this far, and if your interested, heres mine:
PS1="\[\033[31m\]\u\033[36m\]@\h\033[31m\] on \l\n\033[1;33m\](\w) #\[\033[0m\]"


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
xterm customization Flexxy Linux - Software 9 02-06-2006 08:27 PM
Shell Customization rcallahan Linux - Newbie 5 01-27-2005 04:11 PM
Customization Jmcatch742 Linux - General 7 08-21-2004 09:55 PM
Logon Customization technochef Debian 3 08-11-2004 09:46 PM
Debain customization. Vipes Debian 3 01-26-2004 10:25 AM

All times are GMT -5. The time now is 08:15 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration