LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 08-01-2006, 12:17 PM   #1
extrasolar
Member
 
Registered: Feb 2004
Location: Northamptonshire, UK
Distribution: Windows XP, Arch Linux
Posts: 131

Rep: Reputation: 16
Gnome Terminal: Show only current directory at prompt?


In gnome terminal how do I prevent a long list of directories being displayed at the prompt and have only the current directory showing?

i.e. user@hostname:/dir3$

instead of user@hostname:/dir1/dir2/dir3$
 
Old 08-01-2006, 12:28 PM   #2
ciotog
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Slackware current
Posts: 728
Blog Entries: 2

Rep: Reputation: 43
You need to set the PS1 environment variable to your liking. It's likely being set in .bashrc, maybe read /usr/doc/Linux-HOWTOs/Bash-Prompt-HOWTO (I think that's where it is in Fedora) for instructions.
 
Old 08-01-2006, 01:20 PM   #3
Vgui
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware
Posts: 496

Rep: Reputation: 31
A quick search turned up:
http://www.comptechdoc.org/os/linux/tips/tipsps1.html
And from reading it looks like \W is what you need.
Add (or edit) the PS1 entry in ~/.bashrc to be similar to:
Code:
export PS1='\u@\h:\W$ '
That should get you going in the right direction.
 
Old 08-01-2006, 01:23 PM   #4
extrasolar
Member
 
Registered: Feb 2004
Location: Northamptonshire, UK
Distribution: Windows XP, Arch Linux
Posts: 131

Original Poster
Rep: Reputation: 16
Cheers. I did do a search on google and I found what I was after. Been experimenting with it.
 
Old 08-01-2006, 01:39 PM   #5
jeelliso
Member
 
Registered: Oct 2005
Location: Knoxville, Tn (USA)
Distribution: OpenSUSE, Ubuntu
Posts: 250

Rep: Reputation: 30
Quote:
Originally Posted by extrasolar
Cheers. I did do a search on google and I found what I was after. Been experimenting with it.
If your results are different from what ciotog found, then please post them so everyone else can see.
 
Old 08-01-2006, 02:11 PM   #6
extrasolar
Member
 
Registered: Feb 2004
Location: Northamptonshire, UK
Distribution: Windows XP, Arch Linux
Posts: 131

Original Poster
Rep: Reputation: 16
http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/index.html

Tons of info on Bash prompt.
 
  


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
change profile to show current directory jpolachak Linux - Newbie 2 01-20-2005 08:36 PM
gnome-terminal fails to give bash prompt wfhoney Red Hat 8 04-21-2004 04:38 PM
Bash, Gnome-Terminal and Prompt Mysteries melquiades Slackware 30 11-28-2003 07:13 AM
current working directory in ksh prompt brian0918 Linux - Newbie 2 06-03-2003 05:34 PM
current working directory in ksh prompt brian0918 Linux - Software 2 06-03-2003 02:50 PM


All times are GMT -5. The time now is 02:33 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration