LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 06-23-2011, 02:26 AM   #1
aggrishabh
Member
 
Registered: Nov 2010
Posts: 87

Rep: Reputation: 1
Present working directory path display help RHEL5*


Hi All,

need to know, how we can display the whole (till current directory) path in below highlighted way. normally it shows only the name of current working directory after the server name.

(1) /abc/xyz/
[lion@test] $
 
Old 06-23-2011, 05:45 AM   #2
siranjeevi
Member
 
Registered: May 2010
Location: India
Posts: 79

Rep: Reputation: 7
Hi,

I dont think you can have that option. You can use the command
Quote:
pwd
this will display the full directory path.

Last edited by siranjeevi; 06-23-2011 at 05:46 AM. Reason: mistakes
 
0 members found this post helpful.
Old 06-23-2011, 05:51 AM   #3
ssrameez
Member
 
Registered: Oct 2006
Location: bangalore
Distribution: Fedora, Ubuntu, Debian, Redhat
Posts: 82

Rep: Reputation: 6
If you are looking for the display along with the shell prompt, you need to add a variable called PS1 in the .profile or .bash_profile file of the user.

have a look at "http://www.thegeekstuff.com/2008/09/bash-shell-ps1-10-examples-to-make-your-linux-prompt-like-angelina-jolie/"
 
Old 06-23-2011, 06:17 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
In the PS1 variable, substitute \W with \w (lowercase w) and it will display the full path of the current directory.
 
1 members found this post helpful.
  


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
present working directory problem. Ribo01 Linux - Newbie 1 11-19-2010 12:57 PM
rhel5 bind9 the working directory is not writable sank1800 Linux - Server 1 02-19-2010 05:42 PM
adding a directory to users path in RHEL5 h0mer0 Linux - Enterprise 3 10-29-2009 10:21 PM
C++: Determining present working directory harshnoise Programming 4 09-16-2005 10:28 AM
Bash's "present working directory" doesn't exit jonr Linux - General 2 11-07-2003 02:58 PM


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