nextfile is not part of posix awk, but it's available on the most popular implementations.
AWK uses extended regular expression, instead of grep's basic flavor. You may need to tweak your regular expressions if they're more complicated than a simple word like "topic".
Since this find prints file, and since you almost certainly don't want to spawn awk once per file, I dropped -n 1 in xargs. Further, sometimes parallelizing i/o bound tasks can degrade performance if the parallel invocations are not backed by different disks. Something to keep in mind. You might actually improve performance by lowering the value of -P (if not by eliminating it altogether).
in aix, i use grep something * to get the files, lines that contain something. but i couldnt get the same result from a sun box. what is the equivalent? thanks (4 Replies)
Hi Friends,
I am having a funny problem with grep. When I run
grep 'expr' file.txt
things work fine. But when try to get the line number using the -n option, i.e,
grep -n 'expr' file.txt
I get a message, "grep: 0652-226 Maximum line length of 2048 exceeded."
If the line has more than... (3 Replies)
I want to serch for a string in all the files in the root directory. i want the search to be limited to only the files in the directory i.e the search to be done only in the files not in the sub directory.
the approaches tried are
1)grep "pattern string"
this command was serching the... (3 Replies)
This may just be a lack of experience talking, but I always assumed that when possible it was better to use a commands built in abilities rather than to pipe to a bunch of commands. I wrote a (very simple) script a while back that was meant to pull out a certain error code, and report back what... (4 Replies)
I want a shell script which does:
-> search all .mov files in a drive (say e: drive) which are above 800 mb of size
-> Delete the searched .mov files which are above 800mb
Thanks,
Manoj (4 Replies)
I am doing an ftp of around 1010 files and I am using mput for this. For some reason its only transferring 10 or 20 files and the rest are
not getting transferred. There is some socket error in the log. is there an issue if we have more than 50 or so files for mput.
here is the o/p in the log... (2 Replies)
Hi all,
I am still learning my way around unix commands and I have the following question.
I have a website and I want to search for all the html pages that don't contain a certain js file. The file I am searching for is located under /topfolder/js/rules.js . So I assume in my grep search I... (5 Replies)
Hi
I am in new in unix,can any one tell how to grep the data by limit.
suppose I have below data:-
is :mSecs
is :mSecs
is :mSecs
is :mSecs
requirement is how to grep the data which is having count greater than 1000 msecs only.
thanks in adnavce. (2 Replies)
hi guys
how can i limit number of files in a disk or partition ?
or how can i make a limit to inode number for a disk or partition ?
ext3 or ext4 file system (1 Reply)
I am trying to find files that have lines in them that end in an r. I have been able to locate files by using the following command:
find . -type f -name "*RECORDS"| xargs grep -l r$
However, I now want to find files that don't end in r anywhere. That means that no sentences or lines in... (9 Replies)
Discussion started by: newbie2010
9 Replies
LEARN ABOUT PHP
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)