The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
more AIX links rayg50 AIX 1 02-14-2008 10:29 PM
About links nagalenoj UNIX for Advanced & Expert Users 1 08-20-2007 12:08 AM
AIX Links Perderabo AIX 0 04-02-2005 06:26 PM
HP-UX Links Perderabo HP-UX 0 04-02-2005 06:15 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-30-2006
uniqmaniak's Avatar
Registered User
 

Join Date: Aug 2006
Posts: 2
Question links

how can we know the different links (hard and soft) to a file .....

i got a file in my directory and i need to know the different links attached to this file


any one plz help

thanks..
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-31-2006
Dhruva's Avatar
Registered User
 

Join Date: Mar 2006
Location: India
Posts: 241
hard link
Code:
ls -li /usr/bin/at
8041 -r-sr-xr-x  4 root  wheel  19540 Apr 21  2001 /usr/bin/at*
Now we will use inode number to find other links since hard links have same inode number.
Code:
find / -inum 8041 -print
For soft link enter
Code:
find /dir_path -type l
this will give you soft links in directory.
or
Code:
find /dir_path -type l -ls|awk '{ print $10,$12}'
will give soft links and associated filename

Last edited by Dhruva; 08-31-2006 at 01:38 AM.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:02 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0