GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script for finding hardlinks
Operating System - HP-UX
1846187
Members
4058
Online
110254
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2006 11:39 PM
10-22-2006 11:39 PM
script for finding hardlinks
Can anyone of you give me a script for finding the hardlinks present in a particular directory(including the sub-directories in that location).
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2006 11:57 PM
10-22-2006 11:57 PM
Re: script for finding hardlinks
Hi,
This is horribly inefficient...
# find /path/to/dir -type f -print | xargs -i find /path/to/dir -type f -linkedto {} -exec ls -1i {} \; | sort -k1 | uniq
PCS
This is horribly inefficient...
# find /path/to/dir -type f -print | xargs -i find /path/to/dir -type f -linkedto {} -exec ls -1i {} \; | sort -k1 | uniq
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2006 11:58 PM
10-22-2006 11:58 PM
Re: script for finding hardlinks
Hi:
# find /path -xdev -type f -links +1|xargs ls -l
...a good example is:
# find /sbin -xdev -type f -links +1|xargs ls -l
...see the manpages for 'find' for more information.
Regards!
...JRF...
# find /path -xdev -type f -links +1|xargs ls -l
...a good example is:
# find /sbin -xdev -type f -links +1|xargs ls -l
...see the manpages for 'find' for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2006 11:59 PM
10-22-2006 11:59 PM
Re: script for finding hardlinks
Hi,
please see:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=87389
and
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=36428
Either way you have to loop through the filenames in your directory tree.
So my (bad) solution would be to do a find and redirect the filename list.
Then use the filname list as input into your solution (inode or linkedto):
find -print > /tmp/x.lis
while read record
do
done < /tmp/x.lis
please see:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=87389
and
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=36428
Either way you have to loop through the filenames in your directory tree.
So my (bad) solution would be to do a find and redirect the filename list.
Then use the filname list as input into your solution (inode or linkedto):
find
while read record
do
done < /tmp/x.lis
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP