LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-06-2005, 08:45 AM   #1
branden_burger
Member
 
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.

Thanks!
 
Old 11-06-2005, 12:20 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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


Cheers,
Tink
 
Old 11-07-2005, 10:34 AM   #3
branden_burger
Member
 
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!
 
  


Reply


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 03:21 PM
how to find directories with a space in it :P ToBe Linux - General 4 01-05-2005 01:10 PM
Latest quota-tools rpm - Where to find pls? (Newbie) KDoc Red Hat 0 08-10-2004 11:40 PM
Where can I find a simple tutorial on quota (limit capacity of disk space of a user)? George2 Linux - Software 5 11-04-2003 08:56 AM
Where can I find a good help page on directories? Travis86 Linux - Newbie 3 01-04-2003 10:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:07 PM.

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