# sh - Determining the size of the catalog



## mitsumoto (Feb 28, 2010)

All greetings!

Now write a script sh and a problem:
It is necessary to determine the size of the directory on the specified path (eg /var/log/test)
and if it is> 100Mb, it is removed in a place with subdirectories and files.

---------
To work with the files I use: `# find /var/log/mysql.log-size +256000 k | xargs rm`
If anyone knows how to do this with directories please please.


Thanks in advance.


----------



## lme@ (Feb 28, 2010)

1) Moved to the appropriate section of the forum...

2) You probably want to use `# find $startdir -type d | xargs du -sk` to get the size of the directories.


----------

