- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HPUX : Find Command , Locating soft and hard link...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО08-01-2002 06:04 AM
тАО08-01-2002 06:04 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 06:08 AM
тАО08-01-2002 06:08 AM
Re: HPUX : Find Command , Locating soft and hard links
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 06:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 06:09 AM
тАО08-01-2002 06:09 AM
Re: HPUX : Find Command , Locating soft and hard links
will find all of the symbolic links.
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 06:10 AM
тАО08-01-2002 06:10 AM
Re: HPUX : Find Command , Locating soft and hard links
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 06:11 AM
тАО08-01-2002 06:11 AM
Re: HPUX : Find Command , Locating soft and hard links
what about using -type l option:
# find / -type l ..
this will list all symbolic links. Read the man pages and check if you need to use the -follow option too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 06:11 AM
тАО08-01-2002 06:11 AM
Re: HPUX : Find Command , Locating soft and hard links
# cd /opt
# find . -type l -exec ls -sl {} \;
==> List all symbolic links recursively in /opt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 06:12 AM
тАО08-01-2002 06:12 AM
Re: HPUX : Find Command , Locating soft and hard links
eg.
cd /usr/sbin
ll vg*
You will see the link count at 31 - all these programs are hardlinked to each other. They have the same sum values also.I think it best to do a sum on all files and those with the same sum value are hardlinks to each other.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 06:14 AM
тАО08-01-2002 06:14 AM
Re: HPUX : Find Command , Locating soft and hard links
Yes you can do it with this command run by root.
# find / -type f | more
or redirect to a file.
Hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 06:15 AM
тАО08-01-2002 06:15 AM
Re: HPUX : Find Command , Locating soft and hard links
instead of:
# find / -type f | more
I actually meant this:
# find / -type l | more
Hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 06:30 AM
тАО08-01-2002 06:30 AM
Re: HPUX : Find Command , Locating soft and hard links
For example if you enter the following command:
ls -li /sbin/vg*
You will see that all of the vg... comands are really one executable file because the inode is the same. They just perform differently when the code determines what hard link name was used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 06:42 AM
тАО08-01-2002 06:42 AM
Re: HPUX : Find Command , Locating soft and hard links
ncheck /dev/vg00/lvol5 | sort -n | awk '$1==prev{print last;print $0}{prev=$1;last=$0}' | uniq
Where /dev/vg00/lvol5 can be replaced with whatever filesystem you wish to scan.
This will produce of a list of all filenames that share the same i-node with at least one other file.
for instance, here are some of the files displayed for /dev/vg00/lvol6 (/usr on my system).
29094 /share/lib/terminfo/5/50
29094 /share/lib/terminfo/w/wy50
29094 /share/lib/terminfo/w/wyse50
29116 /share/man/man1m.Z/mount_cdfs.1m
29116 /share/man/man1m.Z/umount_cdfs.1m
The first number is the common i-node number. The filename that follow is relative to the filesystem you are scanning.
Depending on the number of files in the filesystem, it could take a while to run.
-- Rod Hills