listing directories larger than specified size?
Hello,
I would like to filter out all directories below a specific directory larger than 1GB. Like list all the Users home directories that are larger than 1GB. I'm experimenting with du -sk in combination with grep but I just can't seem to figure out how to do this. Im quite new to linux so bare with me. Anyone has any thoughts on how to do this? Any help will be appreciated! Regards, Zefyr |
You can use du in conjunction with gawk, e.g.
Code:
du -ks /home/*/ | gawk '$1 > 1000000 {print $2}' |
Quote:
While I'm at it, would you (or anyone for that matter) happen to know how to schedule this so that it runs every day at a specific time? That is if I put it in a script. Thanks again! Zefyr |
You may have a look at
Code:
man crontab # describes the crontab command Code:
35 17 * * 3 $HOME/test.sh |
Quote:
Thanks for your help! |
Here's a nice explanation/examples using cron
http://www.adminschoice.com/docs/cro...Crontab%20file |
All times are GMT -5. The time now is 02:34 PM. |