Incoming from Cory Syvenky:
> 
> Problem: Trying to compute disk space usage based on folder names listed
> in a file.
> 
> Current Situation: I've run grep and find until the point where I know I
> have a file that contains every folder that I need to sum up.
> 
> I know du -ah will do everything that I need it to. But I can't figure out
> how to run that command on every line of my file and compute a total.

You might try something like:

  find . -type d -exec du -s {} \;

That would give you much better output that would be more amenable to
arithmetic.  du -ah gives fairly messy output in comparison.  How, in
a script, do you add these up:

4.0k    ./.saves-483-infidel.spots.ab.ca~
2.3M    ./.jnewsrc-spots~
0       ./.saves-24502-infidel.spots.ab.ca~
4.0k    ./.saves-7770-infidel.spots.ab.ca~
1.8M    ./.jnewsrc-dfn~

Yes, it can be done, but not as easily.


-- 
Any technology distinguishable from magic is insufficiently advanced.
(*)               http://www.spots.ab.ca/~keeling 
- -

_______________________________________________
clug-talk mailing list
[EMAIL PROTECTED]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca

Reply via email to