LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 05-07-2008, 08:17 AM   #1
chandran.sanjeev
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.

THANKS FOR THE HALP IN ADVANCE.
 
Old 05-07-2008, 08:34 AM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Do you mean "Displayed at the prompt?" If so, look at
Code:
$ 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, 08:38 AM   #3
rlhartmann
Member
 
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, 08:38 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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:
http://tldp.org/HOWTO/Bash-Prompt-HOWTO/index.html
 
  


Reply

Tags
path, terminal



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

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