[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: File size reporting
- To: yevgeny <publicom(at-nospam)barak.net.il>
- Subject: Re: File size reporting
- From: Oleg Goldshmidt <ogoldshmidt(at-nospam)computer.org>
- Date: 04 Apr 2001 19:29:39 +0200
- Cc: linux-il(at-nospam)linux.org.il
- Delivered-To: linux.org.il-linux-il@linux.org.il
- In-Reply-To: yevgeny's message of "Wed, 4 Apr 2001 17:37:17 +0200"
- Organization: Speaking for myself only.
- Original-Sender: ogoldshmidt@computer.org
- References: <01040417371800.01319@evgenyp>
- Reply-To: ogoldshmidt(at-nospam)computer.org
- Sender: ogoldshmidt(at-nospam)comgates.co.il
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
- User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Cuyahoga Valley)
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