Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 05-28-2010, 12:26 PM   #1
Registered: Oct 2002
Posts: 510

Rep: Reputation: 73
bash prompt question

bash is my default shell, mandated by our IT dept, and I have PS1 set as follows;

PS1="\d \@ [ \u on \h ]\n\w\n> "

The \w returns the current working directory. When I'm in my home directory it's returned as "~" which is OK but I was wondering, is there a way to get it to return as /home/myaccount?
Old 05-28-2010, 12:43 PM   #2
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Debian "Testing"
Posts: 6,096

Rep: Reputation: 408Reputation: 408Reputation: 408Reputation: 408Reputation: 408
Try substituting \$(pwd) for \w
Old 05-28-2010, 12:49 PM   #3
Registered: Oct 2002
Posts: 510

Original Poster
Rep: Reputation: 73
Thanks tredegar, that worked.


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 Hoofty Linux - General 1 03-15-2006 05:54 PM
bash prompt subG Slackware 6 01-18-2006 05:43 PM
Curious bash prompt editing question. xconspirisist Linux - Software 3 11-19-2005 08:24 PM
Question about bash prompt sangjin Linux - Newbie 2 07-30-2003 03:08 AM
Bash Prompt Question ghight *BSD 6 01-31-2003 01:30 PM > Forums > Linux Forums > Linux - Newbie

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