Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 11-19-2003, 07:09 PM   #1
LQ Newbie
Registered: Nov 2003
Location: Montreal Canada
Distribution: Mandrake 9.2
Posts: 17

Rep: Reputation: 0

How does one incorporate the "pwd" into there shell prompt.

so instead of seeing:
[root@PENGUIN666 tss]#

you would see:
[root@PENGUIN666 /home/tss]#

Thank you.
Old 11-19-2003, 07:54 PM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Instead of using \w I believe it would be a capital W like:

PS1='\u@\h\W\$ '

One reason I wouldn't want the full path instead of the current directory is if or when your in a say a sub directory so deep, your prompt is only going to get longer.

Say you cd'd into: /usr/local/bin/blah/blah/blah

Your prompt is going to reflect that.

man bash for all your options in setting up your prompt.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
changing a users pwd ALInux Linux - Newbie 1 11-07-2005 12:44 PM
reset pwd to root's current pwd? ataraktos2 Linux - General 10 04-26-2005 04:13 AM
changed pwd tekmorph Linux - Security 5 09-15-2004 09:47 PM
pwd problem naren Programming 1 04-01-2004 04:52 AM
pwd and the directory above sneezesnoeze Linux - Newbie 3 03-26-2004 07:18 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:02 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