1852320 Members
4450 Online
104065 Solutions
New Discussion

Re: du -sk

 
SOLVED
Go to solution
j773303
Super Advisor

du -sk

is it possible calculate the size of files in the directory? for example: du -sk /tmp/m* ,
That's how to calcualte all size of m* in /tmp . Thanks.
Hero
1 REPLY 1
Trond Haugen
Honored Contributor
Solution

Re: du -sk

Don't know about such a command. But it could easily be scripted. Something along the line of:
TOTAL=0
for SIZE in $(du -sk /tmp/s* | cut -f1 -d" ")
do
let TOTAL=$TOTAL+$SIZE
done
print $TOTAL

Thats a tab in the quotes.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn