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...
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
...
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
...
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...
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...
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.
...