This will work as follows: the innermost grep will search for files that have "AAA" and print the filenames. The filenames printed are used by the second grep to search for string "BBB". This grep will also print the filenames. Now the filenames printed by the second grep contain both "AAA" and "BBB". Then the last(outermost) grep will search for "CCC" in the filenames printed by the second grep. The filenames that are printed by the outermost grep contain all three patterns.
I want to search a heap of files but using an either OR or AND condition for two or more strings. How can I do this?
i.e. file1 has the following
file testfile primary
and file2 has this ...
file testfile2 secondary
If I use this ...
find . -type f -exec grep "testfile" {}... (2 Replies)
I have a .txt file which contains several lines of text. I need to write a script program using grep or any other unix tool so as to detect part of the text (words) between / / that begin with the symbol ~.
For example if somewhere in the text appears a webpage address like... (8 Replies)
Hi,
By using shell scripit i have save output in one file. I want to grep two words named CLUSTER and CLUSQMGR from that output file. How to grep that. output file would be having below words
TYPE(QCLUSTER) ALTDATE(2010-05-17)
CLUSTER(QS.CL.MFT1) ... (5 Replies)
How do you negate a literal hyphen/dash in a regex? If it's the first character inside the brackets, then it is read literally.
But if you stick a caret to the left of it, to negate it, then it seems it is no longer read literally. Or whatever, it doesn't work.
Nor does escaping it seem to... (3 Replies)
Queue on node in domain
description :
type : local
max message len : 104857600
max queue depth : 5000
queue depth max event : enabled
persistent msgs : yes
backout threshold : 0
msg delivery seq :... (4 Replies)
Hi,
I want to grep a file if any one (GH, IJ, KL) is not null. If it is null i dont want to pull anything.
cat file | awk '{print ($1)}'
Parameters are : AB=123;CD=456;EF=6789;
cat file | awk '{print ($2)}'
GH=456;IJ=789;KL=1011
eg:
Contents in file:
Parameters are :... (10 Replies)
Hi!
I'm trying to figure out how to find words with X number of doubles, only. I'm searching a dictionary, (one word per line). For instance, if you want to find words containing only one pair of double letters, you could do something like this:
egrep '(.)\1' wordlist.txt |egrep -v '(.)\1.*(.)\2'... (3 Replies)
see I have a text like:
27-MAY 14:00 4 aaa 5.30 0.01
27-MAY 14:00 3 aaa 0.85 0.00
27-MAY 14:00 2 aaa 1.09 0.00
27-MAY 14:00 5 aaa 0.03 0.00
27-MAY 14:00... (3 Replies)
Discussion started by: netbanker
3 Replies
LEARN ABOUT V7
zgrep
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)