Re: Is there a shell tool to find folders greater than a given size?
Re: Is there a shell tool to find folders greater than a given size?
- Subject: Re: Is there a shell tool to find folders greater than a given size?
- From: "Gary (Lists)" <email@hidden>
- Date: Fri, 29 Feb 2008 21:46:04 -0500
- Thread-topic: Is there a shell tool to find folders greater than a given size?
"Gary (Lists)" wrote:
> Is there something shelly that reports back a list, with paths, of all folders
> exceeding some size limit, given some start folder?
> I have been working on this (AS) script that reports in HTML about folders
> whose size is greater than some given size [*], in an hierarchical report.
> [*]
> The Finder does a fast and fine job of getting a list of big folders with the
> command:
>
> every folder of _someFolder whose physical size is greater than _someSize
>
> The real work is just managing the list of hierarchical results, since I only
> want to keep drilling down folders that exceed the limit, until there are not
> any more folders that do...then I've found the folder(s) contributing the
> weight.
"Mark J. Reed" wrote:
> The size of a folder (beyond the physical size of its directory list)
> is not readily available in the shell. Typically you use the "du"
> (disk usage) command to add up how much space a folder's contents take
> up. You could pipe the result through awk to find the folders whose
> size exceeds your threshold value...but you'd still have the list
> management problem. I think I'd stick with the Finder on this one.
Thanks, Mark. I see what you mean and I think you're right. I'll stick
with the Finder script version.
It is good to know about "du". I figured there was some such beast.
"Peter Baxter" wrote:
> Why not use AS as this is a site for such scripts?
Hi Peter.
I know this is an AS list, thanks. I think maybe you didn't read my post.
> tell application "Finder"
> get the name of every folder whose physical size is greater than
> 5.74971904E+9
> end tell
Yes, I wrote that already. ;)
"demski" wrote:
> Hey Gary!
> I tried this out, just because I was interested, does it not do what
> you wanted?
Hi Demski.
Yes, your script is generally in line with my approach (that is, looping
around and getting physical sizes.)
> tell application "Finder"
> set bigones to {}
> set vols to {}
> set bigones to get the name of every folder whose physical size is
> greater than 256000
> [...]
My real work, as I wrote and as Mark reiterated, is not gathering size data.
Managing that list, to prepare it in a human-useful way, is the real work.
I currently present a nice HTML report, with clickable URL links (posix
paths) to get to those 'offending' folders.
Since you're interested, I'll be sure to share the script with you.
--
Gary
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden