![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to a prompt a particular value??? | grajesh_955 | Shell Programming and Scripting | 2 | 03-11-2008 04:44 AM |
| OK prompt | hshapiro | SUN Solaris | 3 | 10-04-2007 04:39 PM |
| prompt within awk | gefa | Shell Programming and Scripting | 7 | 03-08-2007 01:44 AM |
| set prompt in sh | yls177 | UNIX for Dummies Questions & Answers | 14 | 03-25-2003 08:36 PM |
| set prompt in sun | inquirer | UNIX Desktop for Dummies Questions & Answers | 2 | 07-10-2002 08:17 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
prompt
how do we change the command prompt? right now my prompt says
felix% where felix is the machine i´m on. but how do we change it? for example, how can i make it say me% and how do we get it to tell us what directory we are under because when i change into a subdir then the prompt doesn´t change to include the subdir the way that dos works under windows. thanks |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
The prompt for bash shells can be changed by altering the PS1 variable.
PS1 can be declared in the global /etc/bashrc file or in ~/.bashrc. My shell prompt looks like the following [Sat Jun 30 15:32 andy@prosentia andy]> The PS1 variable in my ~/.bashrc file looks like the following PS1="[\d \t \u@\h \W]>" \d is date \t time \u user @\h @hostname \W basename for current directory the bash man file has details on different flags to alter the prompt if your current directory was /usr/bin PS1="me \W>" would show: me bin> PS1="me \w>" would show: me /usr/bin> Andy Hibbins |
|||
| Google The UNIX and Linux Forums |