[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File size reporting



yevgeny <publicom@barak.net.il> writes:

> I would like to get a total file size reporting for multy-level directory 
> structure, like right click-> Properties in Windows.
> 
> Note, i don't need a disk usage ( du -sk ), just total file size. 
> 
> wc -c gives me the total for files, not recursively drops into directories.

find . -type f | xargs wc -c | tail -1
ls -lR | awk '$1 !~ /(^total|:$)/ {tot += $5} END {print tot}'

Note that the results may differ... there was a thread about it not
long ago.

> Is it correct to make a tar for the directory including all the levels and to 
> look at the tar file size ?

That's what you'll get - the size of the tar file.

-- 
Oleg Goldshmidt | ogoldshmidt@NOSPAM.computer.org 
"I'd rather write programs to write programs than write programs."

=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il