Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-01-2004, 04:40 AM   #1
Registered: Nov 2003
Distribution: Gentoo, Debian
Posts: 188

Rep: Reputation: 30
getting custom PWD in bash prompt

Hello...well I was messing around with /etc/profile, putting in colors for the logins and whatnot, but I was curious as to how I could get the default custom PWD in the bash prompt? If I use ${PWD} it will just put in the /home/max but if I use "\w" it will do ~ and then keep going from there if I plan on going deeper in my home directory. I can't seem to keep the standard bash way of just saying the current directory, without the full path (like [me@nuttylove max]...Is there possibly another command that just prints this that I could put into PS1? Thanks!
Old 08-01-2004, 09:46 AM   #2
LQ Addict
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
\w the current working directory
\W the basename of the current working directory
Old 08-09-2004, 01:39 AM   #3
Registered: Nov 2003
Distribution: Gentoo, Debian
Posts: 188

Original Poster
Rep: Reputation: 30
Hey, thanks alot man! just what I needed


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
bash prompt subG Slackware 6 01-18-2006 05:43 PM
reset pwd to root's current pwd? ataraktos2 Linux - General 10 04-26-2005 05:13 AM
help with bash prompt everythingand2 Linux - Newbie 7 12-06-2003 05:28 PM
can't make custom prompt work for root!? jaregi Linux - General 4 09-10-2003 12:40 AM
Custom boot prompt. drewskiamk Linux - General 1 06-22-2003 02:42 PM

All times are GMT -5. The time now is 10:03 PM.

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