Solved

AIX -- du is missing the -c flag -- any way to easily get a grand total?

Posted on 2013-06-27
3
546 Views
Last Modified: 2013-07-03
du on AIX is missing the -c flag.   Is there an easy way to get a grand total?
0
Comment
Question by:Xetroximyn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 39282152
"du" for a single directory tree shows the total value for the directory in question on the last line,

so if you run "du /tmp" you will see the last line as something like

12345   /tmp

That's the total for /tmp, everything above is detail output and the values are contained in the value shown on the last line.

"du" for several directories ("du /tmp /var" for example) is another case.

You could (additionally?) run such a "du" with the "-s" (= sum) option and add the values like this:

du -s /tmp /var | awk '{sum+=$1; print} END {print sum, "\ttotal"}'

The "coreutils" package in the AIX toolbox collection or from
http://www.perzl.org/aix/index.php?n=Main.Coreutils 
contains the GNU version of "du", which supports "-c".
0
 
LVL 27

Expert Comment

by:skullnobrains
ID: 39289510
use '-s' flag instead of '-c'
0
 

Author Closing Comment

by:Xetroximyn
ID: 39298636
ty!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question