Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-06-27
3
Medium Priority
?
564 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
3 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 2000 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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
Course of the Month10 days, 15 hours left to enroll

886 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