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 10-15-2010, 04:59 AM   #1
LQ Newbie
Registered: Sep 2010
Posts: 3

Rep: Reputation: 0
Configure Bash Prompt. Don't Show the whole $PATH.


Could somebody help me please? I would like to modify Bash Prompt so it does not show the whole $PATH but just the current and parent directory.
I am using Ubuntu.
Old 10-15-2010, 05:11 AM   #2
Registered: Sep 2003
Posts: 382

Rep: Reputation: 87
Have you tried setting the value of the variable PROMPT_DIRTRIM to 2?

That will print dots "..." in place of any proceeding list of directories.
For example, if I'm several levels deep in directories, the path ( is using
\w in the prompt definition ) with the last two levels named KEEP and THIS,
would show up this way:

1 members found this post helpful.
Old 10-15-2010, 05:14 AM   #3
Senior Member
Registered: Apr 2007
Location: bbsr,orissa,India
Posts: 1,373

Rep: Reputation: 135Reputation: 135
1 members found this post helpful.
Old 10-15-2010, 05:26 PM   #4
Registered: Aug 2004
Location: Israel
Distribution: Ubuntu 10.10
Posts: 271

Rep: Reputation: 34
Look at this guide:, it is very detailed and helpful, with lots of nice examples etc.
1 members found this post helpful.


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 shell prompt show incorrect hostname. hari85 Linux - Newbie 3 06-22-2010 05:10 AM
keychain prompt doesn't show up from gdm login oliverdain Linux - Desktop 5 04-15-2010 12:46 AM
bash script path issue - how to pass a path as a string to a variable PiNPOiNT Programming 5 04-17-2009 06:48 PM
configure bash to not show what you type until the prompt juanbobo Linux - Software 1 04-01-2005 02:55 PM
How to configure Konsole bash prompt? lasindi Linux - Software 6 01-16-2005 06:38 PM > Forums > Linux Forums > Linux - Newbie

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