zcat

zcat won't unzip files properly

Hi, I need to unzip a compressed file on the fly in my program. It works when I try it on my own linux computer, but for some reason the school computers fail whenever I tell them to do it. To unzip I'm using the following command: zcat /file/address/file.tar.gz and get the error: /file/address/file.tar.gz.Z: No such file or dir...

zcat pipe to grep

ls -ltr|grep 'Mar 4'| awk '{print $9 }'|zcat -fq |grep 12345 I want to find all files modified on a certain date and then zcat them and search the fiels for a number string. the above doesn't work because it searches the file name for the string not the file itself. Any help? M ...

zcat to grep with file name

ls -ltr|grep 'Mar 4'| awk '{print $9 }'|xargs zcat -fq |grep 12345 I'm now using this command to list the records that contain my numeric string how can i alos get this command to print the name of the file the strings were found in? thanks ...

zcat files in and not in gzip format

I have all my Apache access log files as access.log, access.log.1 access.log.1.gz etc... What I want is to zcat all files in and not in gzip format and pipe them into an X program. I know I can do: zcat /var/log/apache2/access.log.*.gz | someapp... but that will just work for *.gz and not the first two logs. Any ideas will be appreciat...

find results piped to zcat and then to head

I'm trying to search for a certain string in a lot of gziped csv files, the string is located at the first row and my thought was to get the first row of each file by combining find, zcat and head. But I can't get them to work together. $find . -name "*.gz" -print | xargs zcat -f | head -1 20051114083300,1070074.00,0.00000000 xargs: zca...

Why doesn't my Perl pipe to zcat die if the file is not there?

If my gz file does not exist, why doesn't it DIE? $ cat test.pl open(FILE, "zcat dummy.gz |") or die "DIE"; $ ./test.pl zcat: dummy.gz: No such file or directory If I read a file normally, it works as expected: $ cat test2.pl open(FILE, "dummy.gz") or die "DIE"; $ ./test2.pl DIE at ./test.pl line 2. ...