links recounting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting links recounting
# 1  
Old 04-05-2006
links recounting

hello i like to know how can i check the number of links that a file has. Thats to say, if i use ls -la i can see its hard links, nor its hard and soft links... can i count the number of soft links that an archive has?

thanks!

Last edited by Jariya; 04-05-2006 at 02:19 PM..
# 2  
Old 04-05-2006
You can't do that with soft links because you can think of it as something like a Windows "shortcut file" that contains a path to the destination file. The inode of the file being pointed to is not changed with an extra symbolic link. You can view the inode number a hard link file points to with ls -li though, so if it is computationally feasible for you to execute a "ls -liR" (at least valid on Linux) on the entire filesystem then you may be able to find all hard links that point to a specific inode by parsing the results (or else you do it programmatically with, say C or Perl programming).
# 3  
Old 04-06-2006
thank you very much
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. AIX

List all the soft links and hard links

Hi I'm logged in as root in an aix box Which command will list all the soft links and hard links present in the server ? (2 Replies)
Discussion started by: newtoaixos
2 Replies

2. Solaris

Hard Links and Soft or Sym links

When loooking at files in a directory using ls, how can I tell if I have a hard link or soft link? (11 Replies)
Discussion started by: Harleyrci
11 Replies

3. UNIX for Advanced & Expert Users

About links

why directory has two links as default. what's the purpose? (1 Reply)
Discussion started by: nagalenoj
1 Replies

4. UNIX for Dummies Questions & Answers

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.. (1 Reply)
Discussion started by: uniqmaniak
1 Replies

5. HP-UX

HP-UX Links

Manufacturer Links Homepage: Hewlett Packard Enterprise (HPE) (the www.hp.com is for the consumer market) Documentation: HPE QuickSpecs Support: https://support.hpe.com Community: https://community.hpe.com FreeWare The HP-UX Porting and Archive Centre (UK) FTP Servers... (0 Replies)
Discussion started by: Perderabo
0 Replies
Login or Register to Ask a Question