Computing.Net > Forums > Unix > Identifying Hard Links

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Identifying Hard Links

Reply to Message Icon

Name: Joy Schoenberger
Date: June 10, 2002 at 07:41:22 Pacific
Comment:

A script I am working on needs to process files returned from the find command. However, many of those files are hard links to other files, and should be excluded from our processing. How do we identify those files that are actually hard links, so we can exclude them. NOTE: We know how to exlude symbolic links, so please answer only if you know how to identify HARD links.



Sponsored Link
Ads by Google

Response Number 1
Name: wpatte
Date: June 10, 2002 at 08:55:31 Pacific
Reply:

To find hard links it is necessary to know the inode number. Inode numbers can be displayed by using ls -i.

Finding hard links when the links are from different directories is more difficult.

The find command can be used to find all directory entries that reference a given inode.
(e.g., find / -inum 456789 -print).


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Identifying Hard Links

shell script hard links www.computing.net/answers/unix/shell-script-hard-links/6853.html

Returning file permissions in Octal www.computing.net/answers/unix/returning-file-permissions-in-octal/4790.html

recursive link copy www.computing.net/answers/unix/recursive-link-copy/6214.html