09-09-2007
Combining find, grep and gzip
I'm trying to see which files have a particular word in them.
The files are all text files but are gzipped and are in sub directories.
In order to view the content of a single gzipped file I tried:
cat filename | gzip -d | less , and it shows the files contents.
But, I want to see a list of all files that contain the word Simon in them.
So far I tried this:
find . -name *-1 -exec cat {} \; | gzip -d | grep -Hi Simon
The above displays the text that was found, but it doesn't print
the file that contains it, well it does print the file name but it says
the file name is "Standard input"
I would like to know the file name that contains the searched text.
I appreciate any help.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
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)
Discussion started by: legharb
3 Replies
2. UNIX for Dummies Questions & Answers
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)
Discussion started by: jinxx
5 Replies
3. Shell Programming and Scripting
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)
Discussion started by: cs03dmj
6 Replies
4. UNIX for Advanced & Expert Users
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)
Discussion started by: charli1
4 Replies
5. Shell Programming and Scripting
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)
Discussion started by: nitrobass24
4 Replies
6. UNIX for Dummies Questions & Answers
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)
Discussion started by: Chetanz
7 Replies
7. Shell Programming and Scripting
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)
Discussion started by: Valkov
4 Replies
8. UNIX for Dummies Questions & Answers
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)
Discussion started by: kalpcalp
1 Replies
9. UNIX for Beginners Questions & Answers
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)
Discussion started by: royinfo.alain
2 Replies
10. HP-UX
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 DEBIAN
jifty::view::static::handler
Jifty::View::Static::Handler(3pm) User Contributed Perl Documentation Jifty::View::Static::Handler(3pm)
NAME
Jifty::View::Static::Handler - Jifty view handler for static files
DESCRIPTION
This is deprecated and is being port to a stack of plack middleware and plack::app::file
This class takes care of serving out static files for a Jifty application.
When fully operational, it will use an algorithm along the lines of the following:
* Static files are served out of a separate root * If static files go through apache:
* How do we merge together the N static roots? * If static files go through Jifty::Handler
* We need a flag to allow them to go through the dispatcher, too
* return "True" (304) for if-modified-since
* if the browser accepts gzipped data,
see if we have a cached gzipped copy
if so, send it
see if we have a marker indicating that gzip is a lose
if so, send uncompressed
gzip the content
send the gzipped content
* if the browser doesn't accept gzipped content
send the content uncompressed
new
Create a new static file handler. Likely, only the "Jifty::Handler" needs to do this.
roots
Returns all the static roots the handler will search
show $path
Handle a request for $path. If we can't find a static file of that name, return undef.
handle_request $path
An alias for "show"
file_path $path
Returns the system path for $path, searching inside the application's static root, loaded plugins' static roots, and finally Jifty's static
root. Returns undef if it can't find the file in any path.
template_exists $path
An alias for "file_path".
mime_type $path
Returns the mime type of the file whose path on disk is $path. Tries to use MIME::Types to guess first. If that fails, it falls back to
"File::MMagic".
send_file $path $mimetype
Print $path to STDOUT (the client), identified with a mimetype of $mimetype.
send_http_header [COMPRESSION, LENGTH, LAST_MODIFIED]
Sends appropriate cache control and expiration headers such that the client will cache the content. COMPRESSION is deprecated
send_not_modified
Sends a "304 Not modified" response to the browser, telling it to use a cached copy.
perl v5.14.2 2010-09-25 Jifty::View::Static::Handler(3pm)