Re: find stmt with -exec wc -l '{}' \;
- From: Dave B <daveb@xxxxxxxxxxxx>
- Date: Wed, 14 May 2008 11:52:24 +0200
On Wednesday 14 May 2008 00:13, David wrote:
Hi all,
So I have a daily files received report that is automated via cron.
It is a find statement that looks like this:
find $DATAINC -type f -mtime -1 -maxdepth 1 -printf "%-52f %15s %33Ac
\n" -exec wc -l '{}' \;| grep -v '^\.' > files_received_rpt_$DATE.txt
This would work except that some files are zipped.
What are some better ways to, alongside filename and size and date,
gather a record length for each file?
Currently, I added -exec wc -l '{}' \;
to the statement, but like I said this data becomes skewed when
certain files are zipped.
Is there a specific unzip cmd that I can use to bypass the zipped
architecture without actually unzipping the file?
Any help here is greatly appreciated! Thanks!
If the files are compressed with bzip2, you can use bzcat. If they are
compressed with gzip or zip (and each zip file contains only a single
archive member), then you can use zcat.
--
D.
.
- Follow-Ups:
- Re: find stmt with -exec wc -l '{}' \;
- From: Dan Stromberg
- Re: find stmt with -exec wc -l '{}' \;
- References:
- find stmt with -exec wc -l '{}' \;
- From: David
- find stmt with -exec wc -l '{}' \;
- Prev by Date: Diff: show only changes made to one file.
- Next by Date: what is the difference between binary and rom files
- Previous by thread: Re: find stmt with -exec wc -l '{}' \;
- Next by thread: Re: find stmt with -exec wc -l '{}' \;
- Index(es):
Relevant Pages
|