/ 2005-05-04 00:40:11 +0200 \ Carlos E. R.:
The Thursday 2005-04-14 at 17:20 +0200, Lars Ellenberg wrote:
Yes, I looked using pin, and it is not there, not in 9.1 nor 7.3. For older versions I would have to search on CDs. Unless the name is different :-?
why ncheck? whats wrong with find . -inum 4711 find . -printf "%i\t%p\n" find . \! -type d -printf "%i\t%p\0" | perl -lp0e 's/\n/\\n/g' | sort or similar?
Er... :-? And... how on earth do you think that could occur to me out of my head? :-p
Worse, when I try to find out what does "find . -inum 4711" means, the command "pinfo find" crashes, and "info find" shows the wrong info page (on SuSE 9.3). For further info, see my email to suse-linux-e.
well. I use man... though, on my suse 9.2, info as well as pinfo does work. this is completely off topice here, but I am bored :-), so find . -inum 4711 answers "which files/directories below the current directory reference inode number 4711" find . -printf "%i\t%p\n" answers "what inodes do all the entries below the current directory reference to?", it prints for each found entry "inode-nr <tab> pathname <newline>" find . \! -type d -links +1 -printf "%i\t%p\0" for each entry that is not a directory and has more than 1 hardlinks (+1 means greater than 1, not greater or equal) the inode number, a tab, and the pathname, with a terminating ascii NUL, so the pathnames may contain even newlines and other strange characters. to sort that by inode number, you can pipe it into "sort -z" (-z for "record separator is NUL, not newline"). or first replace all newlines with the two character escape sequence backslash n, then replace the termination NUL with a real newline, then sort by line (what I did above). to be able to reliably unescape that, you'd actually need to escape the backslash itself, too. so to conveniently and reliably list all files that reference an inode which is referenced more than once, you do my_ncheck() { find "$@" \! -type d -links +1 -printf "%i\t%p\0" | perl -lp0e 's:\\:\\\\:g;s:\n:\\n:g' | sort } to easily see what I mean: mkdir -p try/d1 try/; touch try/d1/{1,2,3,4}; cp -al try/d{1,2} my_ncheck try | perl -pe '/^(\d+)\t/; s/^(\d+)// if $1 eq $l; $l = $1;' 252247 try/d1/1 try/d2/1 252248 try/d1/2 try/d2/2 252249 try/d1/3 try/d2/3 252250 try/d1/4 try/d2/4 if you want to cover a huge directory tree (e.g. full file system), it will take some time, and you want to ... > tmp.dups ; sort < tmp.dups > tmp.dups.sort cheers, Lars Ellenberg