LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   shell customization (https://www.linuxquestions.org/questions/linux-newbie-8/shell-customization-429470/)

nick021 03-28-2006 09:21 PM

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

tw001_tw 03-28-2006 09:31 PM

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!
-tw

-----------------------------

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 "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: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'


Links:
http://www-128.ibm.com/developerwork.../l-tip-prompt/

http://sourceforge.net/projects/bashish


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\]"


All times are GMT -5. The time now is 02:36 PM.