LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 03: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, 04:11 AM   #2
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
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, 04:14 AM   #3
divyashree
Senior Member
 
Registered: Apr 2007
Location: Bangalore, India
Distribution: RHEL,SuSE,CentOS,Fedora,Ubuntu
Posts: 1,386

Rep: Reputation: 135Reputation: 135
http://www.cyberciti.biz/tips/howto-...up-prompt.html
 
1 members found this post helpful.
Old 10-15-2010, 04:26 PM   #4
z-vet
Member
 
Registered: Aug 2004
Location: Israel
Distribution: LMDE 5
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:51 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
Open Source Consulting | Domain Registration