Differences between version 21 and predecessor to the previous major change of BashOneLiners.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 21 | Last edited on Monday, July 17, 2006 8:12:59 pm | by AlastairPorter | Revert |
Older page: | version 20 | Last edited on Monday, January 16, 2006 11:08:26 pm | by MattBrown | Revert |
@@ -69,4 +69,18 @@
awk '/^iface bar/,/^$/ {print}'
</verbatim>
This prints everything from the line starting with 'iface bar' to the next blank line to stdout.
+
+----
+
+!!! Counting disk usage from find output
+
+Thanks to [#wlug], you can choose from a multitude of options
+
+ <verbatim>
+ find /foo | xargs du -s
+ find /foo -print0 | xargs -0 du -sh
+ find /foo | xargs ls -l | awk '{sum += $5} END {print sum}'
+ find /foo -printf '%s\n' | awk '{sum+=$1} END {print sum}'
+ find /foo -printf '%k\n' | awk '{sum+=$1} END {print sum,"kbytes"}'
+ </verbatim>