Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to determine where sym-link points to

Status
Not open for further replies.

guenter

Programmer
Jul 14, 2000
16
AT
hi,

my question is about how to determine the filesystem of the current directory
for example:

I have 2 filesystems /opt and /u01

In Directoy /opt is a symlink 'mydir' which points to /u01/home/

now I would like to determine when I'm in /opt/mydir that my current filesystem is /u01

Is there a easy way to find that out. ?

thanks
guenter

guenter
mail: porzer_guenter@hotmail.com
 
Running /bin/pwd should show you the "real" directory you're in. This gets around shell built-in commands or aliases that may give you the directory name in terms of the symbolic links followed.
 
My understanding is that you want to find "mydir" on original file system.

#cd /opt/mydir
#df -k .

Ex:

bash-2.03# cd /opt
bash-2.03# ls -la mydir
lrwxrwxrwx 1 root other 12 Oct 27 15:35 mydir -> /test1/mydir
bash-2.03# pwd
/opt
bash-2.03# cd /test1/mydir
bash-2.03# df -k .
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t5d0s4 2010110 236510 1713297 13% /test1


In above example "mydir" originally on /test1 file system and linked to /opt/ file system.
 
Thanks for your answers !

guenter



guenter
mail: porzer_guenter@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top