I'm would like to do a "du -sk *" of a directory and for each line that produces, if the size of the directory is greater than 800MB, do a "du -sk" of that directory, then continue. Since this seems to be something that needs to be "line-based" rather than "word-based", I thought that maybe AWK could do it. The du, of course, prints out the size and the folder path as in:
382856 work/abc
725659 work/def
1338763 work/ghi
I'd like to take each line, and if the number is greater than 800000, then do 'du -sk' of that subdirectory, then continue.
Would I do this best with AWK?
thanks,
Scott
saw@ternion.com
382856 work/abc
725659 work/def
1338763 work/ghi
I'd like to take each line, and if the number is greater than 800000, then do 'du -sk' of that subdirectory, then continue.
Would I do this best with AWK?
thanks,
Scott
saw@ternion.com