[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] [Fwd: Internet Cache Usage]
- Subject: [ale] [Fwd: Internet Cache Usage]
- From: kaboom at gatech.edu (Chris Ricker)
- Date: Thu Feb 12 09:13:19 2004
- In-reply-to: <[email protected]>
- References: <[email protected]>
On Wed, 11 Feb 2004, Jonathan Glass wrote:
> Question: What is the easiest way to get a sum total of all the file
> usage in the report? I'm going to rerun it sans the -h option so it will
> be in blocks. Should I just run it through a bash script, doing a cut -f
> 1 and recursively adding the sizes? Is there a more elegant, command-line
> method?
Generally, awk works better than bash for something like this.
awk '{ foo += $1 } END { print foo }' report.txt
would print out the total (assuming report.txt contains everything in
blocks, and not humanly readable sizes like it is now)
You could instead do something like
awk '{ foo += $1 } END { print foo/1024 }' report.txt
to convert it back to humanly readable....
later,
chris