FL17@DLRVMBS.BITNET (01/29/91)
Date: 29 January 1991, 11:58:25 MEZ From: Ralf Beyer (0531) 395-2530 FL17 at DLRVMBS To: info-iris at brl.mil Listing file links Hi, 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 ? Thanks and best regards Ralf Beyer fl17@dlrvmbs.bitnet
wicks@DCDMJW.FNAL.GOV ("Matthew J. Wicks") (01/29/91)
>>Date: 29 January 1991, 11:58:25 MEZ >>From: Ralf Beyer (0531) 395-2530 FL17 at DLRVMBS >>To: info-iris at brl.mil >> >>Listing file links >> >>Hi, >> >>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 ? >> >>Thanks and best regards >> >>Ralf Beyer >>fl17@dlrvmbs.bitnet >> 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. Matt Wicks Fermi National Accelerator Laboratory wicks@fnal.fnal.gov 708-840-8083
brendan@illyria.wpd.sgi.com (Brendan Eich) (01/30/91)
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