LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-15-2010, 04:59 AM   #1
chelino
LQ Newbie
 
Registered: Sep 2010
Posts: 3

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


Hi!

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.
Thanks
 
Old 10-15-2010, 05:11 AM   #2
kakaka
Member
 
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:


~/.../KEEP/THIS
 
1 members found this post helpful.
Old 10-15-2010, 05:14 AM   #3
divyashree
Senior Member
 
Registered: Apr 2007
Location: bbsr,orissa,India
Distribution: RHEL5 ,RHEL4,CENT OS5,FEDORA,UBUNTU
Posts: 1,362

Rep: Reputation: 135Reputation: 135
http://www.cyberciti.biz/tips/howto-...up-prompt.html
 
1 members found this post helpful.
Old 10-15-2010, 05:26 PM   #4
z-vet
Member
 
Registered: Aug 2004
Location: Israel
Distribution: Ubuntu 10.10
Posts: 271

Rep: Reputation: 34
Look at this guide: http://tldp.org/HOWTO/Bash-Prompt-HOWTO/, it is very detailed and helpful, with lots of nice examples etc.
 
1 members found this post helpful.
  


Reply


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


All times are GMT -5. The time now is 08:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration