Quote:
Originally Posted by
sb008
if you use "-type f" in the "find" command as posted earlier, it shouldn't bring up directories.
Ah my bad I wasn't clear enough
with the -f limiting it to file names I get with the find , find $dir -type f -exec du -k {} \; 2>>/dev/null | sort -rn | head -${hd}
the following
480056 /somedir/test.txt
98911 /anotherdir/anotherfile.sh
Whereas with du -ks * | sort -rn |head -10 where I would prefer the same as the find above with the directories.
22016 temp_file
40000 bin ( a directory)
However while working out how to stop find recursing directories I answered my own question.
du -k * | sort -rn | head -10 gives the same answer as the find.
.