$PWD vs `pwd`


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers $PWD vs `pwd`
# 8  
Old 01-18-2012
just for peace:
aix 4.2.1:
Code:
ge2:/home/vbe $ cd /u
ge2:/u $ pwd
/u
ge2:/u $ /usr/bin/pwd
/home
ge2:/u $ pwd -P
/home
ge2:/u $ oslevel
4.2.1.0

AIX 6:
Code:
n12:/u $ pwd
/u
n12:/u $ pwd -P
/home
n12:/u $ oslevel
6.1.0.0
n12:/u $ /usr/bin/pwd
/home
n12:/u $ echo $PWD
/u

sparc solaris 10:
Code:
lo4:/export/home/vbe $ cd /bin
lo4:/bin $ pwd
/bin
lo4:/bin $ /usr/bin/pwd
/usr/bin
lo4:/bin $ pwd -P
/usr/bin
lo4:/bin $ uname -r
5.10


Redhat 5 entreprise:
Code:
rh5:/usr/tmp $ pwd
/usr/tmp
rh5:/usr/tmp $ pwd -P
/var/tmp
rh5:/usr/tmp $ echo $PWD
/usr/tmp
rh5:/usr/tmp $ /usr/bin/pwd
-ksh: /usr/bin/pwd: not found [No such file or directory]
rh5:/usr/tmp $ /bin/pwd
/var/tmp
rh5:/usr/tmp $  
rh5:/usr/tmp $ uname -r
2.6.18-238.9.1.el5


Last edited by vbe; 01-18-2012 at 09:24 AM.. Reason: add rh5
These 2 Users Gave Thanks to vbe For This Post:
# 9  
Old 01-18-2012
Yes Methyl!!
Code:
pwd -P

makes the difference.
Code:
pandeeswaran@ubuntu:~/lnktraining$ pwd
/home/pandeeswaran/lnktraining
pandeeswaran@ubuntu:~/lnktraining$ pwd -P
/home/pandeeswaran/training

In my system , i am not able to find /usr/bin/pwd command.
Code:
pandeeswaran@ubuntu:~/lnktraining$ /usr/bin/pwd
bash: /usr/bin/pwd: No such file or directory

Thanks.

Now i get the differences.
I guess in most of the linux systems,
Code:
/usr/bin/pwd

command is not usually available.

Thank you very much!

Last edited by pandeesh; 01-18-2012 at 11:12 AM.. Reason: Added some more points
# 10  
Old 01-18-2012
You will find /usr/bin/ on all UNIx system that a SVR4 compliant for in the SVR4 file system layout, the directory /usr deifinition is: Sharable operating system commands, libraries and documentation.
To not let people panic at the time when migrating to the new structure, links were provided for compatibility. HP had even what they called "transition links" ( HP-UX 9 to HP-UX10...)
Linux are not SVR4 compliant...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

$pwd

Hi all,when I cd to an environment variable "cd $MYDIR, if I type pwd, I don't the path to the environment variable dir I cd to. Appreciate the help, regards..Abbya (5 Replies)
Discussion started by: abbya
5 Replies

2. Shell Programming and Scripting

Help with 'pwd' command

Dear all, I am trying to use 'pwd' command in following way. current_directory == /dirA/dirB/test/dirC if ; then do this fi I am not sure how to pass this in command way. Please help! thanking you, emily (10 Replies)
Discussion started by: emily
10 Replies

3. UNIX for Dummies Questions & Answers

pwd help

Dear users, One more question, In unix when i use pwd the following I get: pwd /Users/username/src/directory name Is there a way to get the out put like this in which the if there is a space in the directory eg directory name it should show as directory\ name:... (2 Replies)
Discussion started by: kevincobain2000
2 Replies

4. AIX

sync samba pwd with aix5.3 pwd

currently, my samba login works just fine. i want my clients to use aix5.3 account to login to samba so they don't have to change samba pwd and aix pwd. i googled, and vi /usr/lib/smb.conf per some of knowledge base, but i could not get to work. aix5.3 and samba 3.0.24.0 thanks in advace..... (2 Replies)
Discussion started by: tjmannonline
2 Replies

5. UNIX for Dummies Questions & Answers

PWD COMMAND

Hi, Can you tell me if there is a command such as pwd which does not give me the absolute NFS pathname i.e. it starts with .autofs? At the moment on the unix when I use the 'pwd' command it always gives me the nfs pathname rather thanthe local pathname of which is what i want, is there an... (4 Replies)
Discussion started by: cyberfrog
4 Replies

6. UNIX for Dummies Questions & Answers

how to connect to /etc/pwd

i've been searching the way to connect to pwd.db file located in /etc/ directory.. since i'm not the root and only one of the users of the server, i need to connect to the database so that i can make a login page for all users of the server.. the file is readable by all users and the permission... (1 Reply)
Discussion started by: meggae
1 Replies

7. UNIX for Advanced & Expert Users

console '# ' with {PWD} ??

Hi people... i recently installed AIX 5.3 on a server... but now when i login with root it only shows '# ' without the location where i am... for example: if im in /usr/local it continues to show only '# ' and i want to see the path like 'root@server:/usr/local#' someone can help me? ... (2 Replies)
Discussion started by: gfca
2 Replies

8. UNIX for Advanced & Expert Users

echo ${PWD#${PWD%/*/*}/}

Can anyone explain this in detail ... echo ${PWD#${PWD%/*/*}/} Thanks in Advance (1 Reply)
Discussion started by: sakthi.abdullah
1 Replies

9. UNIX for Dummies Questions & Answers

pwd

Home directory mounted on one local system as /home/username, same directory mounted on a remote system as /home/engr/username. How to use command to use remote host pwd. For example rsh <remote host> ls -l ~pwd (2 Replies)
Discussion started by: bugsandbunny
2 Replies

10. Shell Programming and Scripting

help on PWD

Hi, We all know that pwd (or echo $PWD) gives us the present working dir as output.... but my doubt is that I'ld like to know how to get the present working folder - I mean - name of the current folder alone.. using pwd command I get the full folder name (right from root path)... I need to know... (2 Replies)
Discussion started by: mohanprabu
2 Replies
Login or Register to Ask a Question