hi,
why the following is giving entire /etc/passwd file as output
even when it does not contain ^ or $ .
grep ' ' /etc/passwd
whereas the following is not giving any output
grep ' ^$ ' /etc/passwd (3 Replies)
How can I perform a grep and it will give me a contain word (maintenance) instead of a string or the whole line of info.
grep with exclusive output?
or is there a CONTAIN with IF statement ?
I have a file call yast2_vhost.conf and it contain multiple entries call
maintenance.html... (2 Replies)
Hi All,
I am getting the output for the following command when i run it on the unix console.
---------------------------
grep `whoami` /etc/passwd | awk '{print ($1);}' | cut -d ":" -f3
----------------------------
But i made it into a script and tried to print the variable, its... (5 Replies)
Hello,
I have a list of stings that I'm using with grep to determine which files contain the strings. Here's what I have now:
list of strings in a file (list.txt):
/directory/direc tory/file.jsp
/dire ctory/directory/direct ory/file.jsp
grep I'm doing to find files that contain the... (4 Replies)
From below mentioned line,i have to display output as last word only ie:arch_1_105366_720809746.dbf
-rw-r----- 1 oracle dba 98887680 02 Mar 12:01 arch_1_105366_720809746.dbf
Please .. (5 Replies)
hi
i am running grep -c on a bunch of files some of which may be non existent. The output i get is in the same order as the files grep checks and this is what i want as i need to copy the output to a spreadsheet. However when i tried to pipe the output to sed to strip away the filenames and just... (5 Replies)
currently I have process from a raw file to this stage
ALTER TABLE "EXCEL_ADMIN"."TC_TXN_VOID" ADD CONSTRAINT "PK_TC_TXN_VOID" PRIMARY KEY ("TC_TXN_IID")
ALTER TABLE "EXCEL_ADMIN"."TC_TXN_AMT" ADD CONSTRAINT "PK_TC_TXN_AMT" PRIMARY KEY ("TC_TXN_AMT_IID")
ALTER TABLE... (10 Replies)
Hi guys -
I am trying to have a certain file display information horizontally divided by a pipe.
for example
file name: foo.dat has information like this:
name1
name2
name3
namenamename4
namene5
I would like it to display like this:
name1|name2|name3|namenamename4|namene5
... (6 Replies)
I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore.
Here is what 's happening:
* I wanted to remove lines containing digits so I used this... (25 Replies)
Hi.
I have a command line that will generate exif data from .jpg files...
So to get the Camera Model I use:
find -iname "*.jpg" -print0 | xargs -0 exiftool -a | grep "Camera Model"
But I want the file name AND the camera model... How to I get the grep to give me TWO bits of information from... (2 Replies)
Discussion started by: TuftyDave
2 Replies
LEARN ABOUT POSIX
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)