Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Unix size

by MidLifeXis (Monsignor)
on Feb 07, 2012 at 13:34 UTC ( [id://952278]=note: print w/replies, xml ) Need Help??


in reply to Re: Unix size
in thread Unix size

'du' counts files so you need the '*' after the directory.

Not true. Under HP-UX, du -s gives the grand total of disk usage for each of the specified name operands.1 The BSD man page for du also includes the -s flag (aka --summary), so it is not quite the same as --total (which BSD also has, but not HP-UX). The total can be obtained with a perl oneliner: perl -ne '@d=split($_); $t += $d[0]; END{print $t}'

1 - HP-UX 11.11 du man page

--MidLifeXis

Replies are listed 'Best First'.
Re^3: Unix size
by cdarke (Prior) on Feb 07, 2012 at 13:53 UTC
    -s is also in the POSIX standard (IEEE Std 1003.1-2008):
    Instead of the default output, report only the total sum for each of the specified files
    but not --total

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://952278]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 17:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found