LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-14-2006, 09:36 AM   #1
CelticBlues
LQ Newbie
 
Registered: Jan 2005
Posts: 29

Rep: Reputation: 15
How can I mod my .bashrc so that it JUST shows the dir I am in?


How can I mod my .bashrc so that it just shows the dir I am in? Currently, when I change directories, I see the entire path.... e.g.

What I see is

user@host:~/This/Is/A/really/long/path/to/display>

But I would prefer

user@host:~/display>

Or something similar...

Thanks,
CB
 
Old 11-14-2006, 09:49 AM   #2
johnpaulodonnell
Member
 
Registered: Jun 2006
Location: Galway
Distribution: Suse 10.1
Posts: 114

Rep: Reputation: 15
You set it via the $PS1 variable...but I don't know the syntax
 
Old 11-14-2006, 09:53 AM   #3
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
Change '\w' to '\W' in the $PS1 variable.
 
Old 11-14-2006, 09:55 AM   #4
Hobbletoe
Member
 
Registered: Sep 2004
Location: Dayton, Oh
Distribution: Linux Mint 17
Posts: 150

Rep: Reputation: 18
PS1="\u@\h:\w >"

Would give you the user,host, and full working directory.

PS1="\u@\h:\W >"

Would give you the user, host, and just your top level directory.
 
Old 11-14-2006, 09:58 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
what you want is the norm on most distro's.... just run "export PS1=\u@\h \W\>"

heh, forgot to press reply...

as a note, you have the ~ symbol in there which is representative of your home directory, so that would not be used if you onyl have a single lower level directory there.

Last edited by acid_kewpie; 11-14-2006 at 09:59 AM.
 
  


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
ndiswrapper shows hardware, but iwconfig shows no device ZST Linux - Hardware 6 04-20-2006 12:15 PM
Share configuratin dir (.dir) for 3 accounts on local computer LiNuXkOlOnIe Linux - Software 5 01-08-2006 03:36 AM
snmp staus shows it running but on trying MRTG, it shows public@ipaddr not giving res swati220781 Linux - Networking 3 07-08-2004 05:32 PM
desktop shows on TV but movie shows black screen litrelord Mandriva 6 07-05-2004 05:10 AM
tech tv shows how to mod x-box. cool Brain Drop General 0 04-02-2003 03:27 PM

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

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