[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Thu Feb 12 09:13:19 2004 -->
- <!--x-from-r13: xnobbz ng tngrpu.rqh (Quevf Dvpxre) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] [Fwd: Internet Cache Usage] -->
- <li><em>date</em>: Thu Feb 12 09:13:19 2004</li>
- <li><em>from</em>: kaboom at gatech.edu (Chris Ricker)</li>
- <li><em>in-reply-to</em>: <<a href="msg00406.html">[email protected]</a>></li>
- <li><em>references</em>: <<a href="msg00406.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] [Fwd: Internet Cache Usage]</li>
> 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
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00406" href="msg00406.html">[ale] [Fwd: Internet Cache Usage]</a></strong>
<ul><li><em>From:</em> jonathan.glass at ibb.gatech.edu (Jonathan Glass)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00431.html">[ale] GROKLAW- SCO Drops Linux Claims</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00433.html">[ale] [Fwd: Internet Cache Usage]</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00415.html">[ale] [Fwd: Internet Cache Usage]</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00433.html">[ale] [Fwd: Internet Cache Usage]</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00432"><strong>Date</strong></a></li>
<li><a href="threads.html#00432"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>