Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


  Search this Thread
Old 05-07-2008, 09:17 AM   #1
LQ Newbie
Registered: Sep 2007
Posts: 3

Rep: Reputation: 0
Unhappy Terminal too bothering

I don't know where this thread actually goes.

A nyways, I just switched from Fedora 8 to Ubuntu 8.04 LTS. I frequently use the terminal. The one noticeable difference between the two is that the Fedora terminal only displays the name of the current directory, whereas the Ubuntu terminal bothers to display the entire path. Its irritating me a lot.

Is there any option available to make the Ubuntu terminal show only the folder name instead of the entire path. I'm sure I can remember which folder is located where.

Old 05-07-2008, 09:34 AM   #2
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,170

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
Do you mean "Displayed at the prompt?" If so, look at
$ set | grep -i prompt
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"'
and see if changing the $PWD part can help. Note that the prompt uses the vaiables USER, HOSTENAME, etc., and substitutes ~ for HOME if it's in the PWD string. Anyhow, you can probably change .bashrc to set the prompt to anything you like when you start a BASH shell.
Old 05-07-2008, 09:38 AM   #3
Registered: Mar 2008
Posts: 73

Rep: Reputation: 16
The bash shell (I assume your using bash)
uses special key sequences to display the prompt.
The prompt is controlled by a variable called PS1.

To see the current prompt, type [B]echo $PS1[B],
the full path is displayed by a \w, to see only the
working dir, you need to change this to a Capital W.

Be sure to set your variable using qoutes:

[B]export PS1="[\u@\h \W]$ " [B]

Note, no spaces around the equal, but a space after the $ if you want it.
Also, from your echo command above, you may have seen a lot of other
stuff, this is usually to set the colors, add those back in if you want.

Variables only exist in RAM, if you want them set when you login
in, add the line above to ~/.bash_profile,
if you want it anytime you open a shell, add it to ~/.bashrc
Old 05-07-2008, 09:38 AM   #4
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735
Wow!!! If this is the only issue you ever have with Linux, then you are really lucky!! Actually, I prefer the opposite--I want to see the whole path.

More than you wanted to know about how to customize it:


path, terminal

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
not screen-blanking in terminal - what sets the idle timeout on monitor for terminal stardotstar Linux - Hardware 2 08-14-2011 06:46 AM
Switching back to the Mandrake 9.1 desktop from terminal rdesktop terminal session marc218 Linux - General 6 02-08-2007 03:45 PM
How to launch an app in terminal, & keep it running after I close terminal? kornerr Linux - General 7 06-24-2006 06:54 PM
Startup scripts not bothering to execute... systemparadox Slackware 3 01-26-2005 01:56 PM
windows is bothering me (image extraction) JZL240I-U Linux - Software 2 12-30-2004 02:26 AM

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

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