07-09-2010
What about zgrep or gzgrep?
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I want to read a directory full of compressed files and move the file to another directory if it meets certain criteria. I only want to look at the first line of the compressed file and if I find the string, do the move. I am currently using the following:
zgrep -R -L... (1 Reply)
Discussion started by: cbreiner
1 Replies
2. UNIX for Advanced & Expert Users
I was wondering if there's a way to search within a file that's been compressed. i.e. if file a is inside file a.zip or a.gz, is there a a command that will retrieve the string of data I'm looking for in file a, and list which compressed file it found it in?
Please help!
Thanks. (8 Replies)
Discussion started by: HLee1981
8 Replies
3. Shell Programming and Scripting
After pouring over my LTKS and Unix in a nutshell, I'm stuck!
I have a large (BMC Report File) that has breaks on DM (district managers).
After a report header, there is a DM header like:
DM: DBP AARON ROBERTS
At the end of each DM break, there is:
** END OF REPORT **
... (6 Replies)
Discussion started by: Jodyman
6 Replies
4. UNIX for Dummies Questions & Answers
Hi,
At my company, we have custom web sites that we create for different clients. The folder structure is something like:
<project name>/html/web/custom/
The custom folder contains a file called "category.html"
Every project has the same folder structure, and same file names but, the data... (2 Replies)
Discussion started by: miklo
2 Replies
5. UNIX for Advanced & Expert Users
Hi all,
I would like to ask whether in Unix shell/perl have any functions or command to allow grep/cat/read a file inside compressed .tgz without extract it?
I know we can tar tvf a compressed tgz but this only allow we read the path/filename contained inside the tarball. If we want to read... (3 Replies)
Discussion started by: mayshy
3 Replies
6. Shell Programming and Scripting
Hi,
I have a folder which contains multiple config.xml files and one input file, Please see the below format.
Config Files format looks like :-
Code:
<application name="SAMPLE-ARCHIVE">
<NVPairs name="Global Variables">
<NameValuePair>
... (0 Replies)
Discussion started by: haiksuresh
0 Replies
7. Red Hat
I was following this tutorial on How install the rpmfusion nvidia drivers in Fedora 13:
F13, F12 & F11 Nvidia driver guides - FedoraForum.org
Here's the tutorial:
And this is what I did:
First I executed the following commands:
su
rpm -Uvh ... (0 Replies)
Discussion started by: skyxn3t
0 Replies
8. Shell Programming and Scripting
I am trying to read a file line by line and then search that line in another file and get a particular column from the second file.
I have written this code.but its not working properly
#!/bin/sh
while read keyword in duplicate.txt
do
echo $keyword
while read line
do
... (7 Replies)
Discussion started by: Prachi Gupta
7 Replies
9. Shell Programming and Scripting
I have many compressed files I want to search using awk and want to print some file contents along with the filename it came from on each output record (I simplified awk command).
Here are the results with the files uncompressed:
awk '{print FILENAME, $0}' test*.txt
test1.txt from test1... (3 Replies)
Discussion started by: mjf
3 Replies
10. Shell Programming and Scripting
I have a environment property file which contains:
Input file:
value1 = url1
value2 = url2
value3 = url3 and so on.
I need to search all *.xml files under directory for value1 and replace it with url1.
Same thing I have to do for all values mentioned in input file. I need script in unix bash... (7 Replies)
Discussion started by: Shamkamde
7 Replies
GZGREP(1) General Commands Manual GZGREP(1)
NAME
gzgrep, gzegrep, gzfgrep - search possibly compressed files for a regular expression
SYNOPSIS
gzgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
gzgrep is used to invoke the grep on compress'ed or gzip'ed files. All options specified are passed directly to grep. If no file is speci-
fied, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and
fed to grep.
If gzgrep is invoked as gzegrep or gzfgrep then egrep or fgrep is used instead of grep. If the GREP environment variable is set, gzgrep
uses it as the grep program to be invoked. For example:
for sh: GREP=fgrep gzgrep string files
for csh: (setenv GREP fgrep; gzgrep string files)
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO
grep(1), egrep(1), fgrep(1), gzdiff(1), gzmore(1), gznew(1), gzforce(1), gzip(1), gzexe(1)
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWgzip |
+--------------------+-----------------+
|Interface Stability | External |
+--------------------+-----------------+
NOTES
Source for gzip is available in the SUNWgzipS package.
GZGREP(1)