Hello,
I am wondering if you can assist with my question and ask kindly for this.
I have a number of files that are listed as file1.gz through file100.gz.
I am trying to perform a grep on the files and find a specific date that only resides within within one of the files. There are... (3 Replies)
Started using unix commands recently.
I have 50 gzip files. I want to grep each of these files for a line count based particular category in column 3. How can I do that?
For example
Sr.No Date City Description Code Address
1 06/09 NY living here 0909 10st st nyc
2 ... (5 Replies)
Hi - can someone please help me combine find, grep and possibly ls into something workable:
i.e. How can I list all the files that contain the word "pet" in all directories under the current directory that are called "animal", bar those anywhere under directories called "archive"?
I suspect... (6 Replies)
Hi all,
what i'm trying to configure its to the following,
find all files older then 1 min,gzip them ,rename/move with date and extension .gz (example tes.log_2012-07-26.gz) and trying to move them to another folder (gzipped),the command i'm typing its this,
find /home/charli/Desktop/test/ -type... (4 Replies)
I am having an issue adding the -size test to my find command.
I am trying to find all files smaller than 250mb, that are not in .snapsnot or man directories.
What i started with
find . -xdev -type d \( -name man -o -name .snapshot \) -prune -o -type f
What I have tried..unsuccessfully... (4 Replies)
Hello
I am trying to select multiple files older than 14 days and create a single compressed file out of it. (AIX Release 3 Version 5)
I am trying to achieve it by following
tar -cvf db01_log.tar `find . -name "db01*.log" -mtime +14" -print`| gzip > db01_log.tar
however it just... (7 Replies)
Hello,
I am trying to write a housekeeping that finds all .trc files older than x days in a given FS, checks if they are used and gzips them if they are not used by any process. I need to do it without calling any additional .sh script.
I managed to make it work for Linux only:
find .... (4 Replies)
Hello!
I have a question about how to combine patterns in grep commands with the OR operator.
So I have this little assignment here:
Provide a regular expression that matches email addresses for San Jose City College faculty. A San Jose City college faculty’s email address takes the form:... (1 Reply)
Hi,
I need to combined in 1 line the execution below :
find * -type f -mtime -$nb_days -print | xargs tar -cvf $MAITUT/BCK_DATA.tar
gzip $MAITUT/BCK_DATA.tar.gz
The fact that the TAR is very big, at the end I need to generate only the GZ file.
The option z on the tar... (2 Replies)
Hello,
I will like to execute a find, tar & gzip in one command.
find * -type f -mtime -$nb_days -print | xargs tar -cvf $MAITUT/BCK_DATA.tar
gzip $MAITUT/BCK_DATA.tar.gz
The fact that the TAR is very big, at the end I need to generate only a compress file.
Please note... (22 Replies)
Discussion started by: royinfo.alain
22 Replies
LEARN ABOUT LINUX
zegrep
ZGREP(1) General Commands Manual ZGREP(1)NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, 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 the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)ZGREP(1)