View the Most Wanted LQ Wiki articles.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-06-2005, 09:45 AM   #1
Registered: Dec 2004
Posts: 66

Rep: Reputation: 15
find, over quota directories

Hello all.

I need to run a simple shell script to find which directories are over 20MB in the /home directory and their sizes. This is what I came up with,

find /home/ -size +20240k -exec ls -sh {}>over_quota \;

But it lists files, and not directories which is what I need.

Old 11-06-2005, 01:20 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,047
Blog Entries: 11

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
find -type d -exec du --max-depth=1 -m {} \;| awk '$1 > 20 {print}'

Old 11-07-2005, 11:34 AM   #3
Registered: Dec 2004
Posts: 66

Original Poster
Rep: Reputation: 15
That was almost it, but this is it!!

find -type d -maxdepth 0 -exec du --max-depth=1 -m {} \;| awk '$1 > 20 {print}'

just needed a maxdepth argument to find...i really need to figure out how to awk, and sed.

Thanks a ton!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quotas- quotaon: Cannot find quota file whitetiger0990 Linux - Software 0 01-08-2005 04:21 PM
how to find directories with a space in it :P ToBe Linux - General 4 01-05-2005 02:10 PM
Latest quota-tools rpm - Where to find pls? (Newbie) KDoc Red Hat 0 08-11-2004 12:40 AM
Where can I find a simple tutorial on quota (limit capacity of disk space of a user)? George2 Linux - Software 5 11-04-2003 09:56 AM
Where can I find a good help page on directories? Travis86 Linux - Newbie 3 01-04-2003 11:09 PM

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration