Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!sgi!brendan@illyria.wpd.sgi.com From: brendan@illyria.wpd.sgi.com (Brendan Eich) Newsgroups: comp.sys.sgi Subject: Re: Listing names of linked files Message-ID: <83098@sgi.sgi.com> Date: 29 Jan 91 19:58:37 GMT References: <9101291417.AA15961@dcdmjw.fnal.gov> Sender: guest@sgi.sgi.com Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 26 In article <9101291417.AA15961@dcdmjw.fnal.gov>, wicks@DCDMJW.FNAL.GOV ("Matthew J. Wicks") writes: > >>Date: 29 January 1991, 11:58:25 MEZ > >>From: Ralf Beyer (0531) 395-2530 FL17 at DLRVMBS > >>To: info-iris at brl.mil > >> > >>does anyone have an idea how to list the (path)names of the files a > >>file is linked to ? ls -l gives the number of links but how can the > >>associated names be retrieved ? > > A combination of ls and /etc/ncheck will provide this information. ls is > required to get the inode number of the file (using the -i option) and > then ncheck will return the path names for this inode. For example, to > determine all the path names of inode 1971 in the root file system, the > following command could be used: > > /etc/ncheck -i 1971 /dev/root > > Please note, you will most likely need to be root for this to work, as you > need to be able to have read permission of the special device file (/dev/root) > for this to work. There's always 'find -inum 1971 -print' if you don't need to look in any directories to which you lack search permission. It's usually a little slower than ncheck. /be