Comments (4)
  • Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry

1 lech77 commented Permalink

(1) One has to remember that expanded "./*" pattern does not contain any names that start with ".", so such files/directories won't be included in the list "du" command produces. (2) Since you are using "-xdev" option for "find" command, you might also consider using "-x" option for "du" command. However, it's a bit tricky because "./*" gets expanded by shell and it may contain also the names of mountpoints in current directory... (3) Nitpicking department: I believe "+$((1024*1024*1024))c " is simpler than "+`echo 1024*1024*1024 | bc`c"

2 frenger commented Permalink

Hi Brian, <br /> We always use #1 to find the usual suspects in /var for example. <br /> Just today I had a filling "/" (root) file system and thought it would be cool to have the #2 command display like #1. Maybe piping the whole thing in sort -n ? A little improvement from my side for #2 - add a "-fstype jfs" to skip NFS mounts. <br /> Regards Sebastian

3 jeffschaller42 commented Permalink

+1 to lech77's note about shell glob expansion; take care, though, if you have crafty users on the system and you're running this as root -- this article came out recently that talks about specially-crafted filenames that could appear as inadvertent parameters to your command! <div>&nbsp;</div> Thanks for the tip about mmin; I almost always use mtime, but mmin could come in handy! <div>&nbsp;</div> Re: frenger's sorting-the-find, that's something I commonly do; AIX's find, I sort with: "find (...etc...) -ls | sort -n +6" to get the output sorted by file size.

4 Gabriel.Menini commented Permalink

# cd /var <br /> # du -m * |sort -nr |head <div>&nbsp;</div> Top-ten list of bigger files or dirs