Hello all
when I do simple grep on file im getting the results of "filename : stringResult "
is there any way to present also the line number in the file ? (1 Reply)
I am new to unix. i need to know how to use grep to grep and expression from a file. and pass the result as a 0 for found and 1 for not found. I can only go up to grep 'Checking Subscription Status' ranos.log. Please help. Thank you. (2 Replies)
Hi guys,
I have the following grep command in a script to search through a file for a string and return its count, and it works fine for when the string exists:
grep "string" file.txt | wc
However, sometimes the result will be 0 and I want the script to take this as the result. Right now... (6 Replies)
Here is my script so far:
set dirs = ` find . -name "message.jar" 2> /dev/null | cut -d "/" -f 2 ` | uniq
foreach dir ( $dirs )
if (grep $dir/* someText==null) --> how do I write this in script?
print $dir
end
end (4 Replies)
Hi,
I know this is a really dumb question, and I used to know how to do this, but I forgot and I can't seem to find the command online anywhere:
When I grep a string, how do I filter the results so that lines containing a certain string are OMITTED!
for example:
grep 'string' *.txt ... (2 Replies)
Trying to create a command line script to look for all files matching a pattern, grep for a specific value in each file, and write out the filename long list. It's possible the filename won't containe the value.
{
echo “Running....”
for fname in 811_Intermediate_File_*
do
grep -l... (3 Replies)
Hi
Please take a look below, I'm grepping for /app/oracle and would like explicitly that result and not /app/oracle/admin as well.
# cat /tmp/fs.list
/app/oracle
/app/oracle/admin
# cat /tmp/fs.list | grep -w "/app/oracle"
/app/oracle
/app/oracle/admin (3 Replies)
Hi
While trying to do a search on solaris, the grep results seems to be appearing on the same line instead of the new line.
Wed Jan 18 14:45:48 weblogic@test:/abcd$ grep qainejb02 *
qa_cluster_biz_view_tc_intl_servers_ports_2:qainejb02 7101
qa_cluster_servers_2:qainejb02... (2 Replies)
Hello.
I want to get all modules which are loaded and which name are exactly 2 characters long and not more than 2 characters and begin with "nv"
lsmod | (e)grep '^nv????????????
I want to get all modules which are loaded and which name begin with "nv" and are 2 to 7 characters long
... (1 Reply)
Hi,
I am running following command in a bash script for testing IO and use grep to get throughput number, but it did not work, it displayed everything:
dd if=/dev/zero of=/dev/null bs=1G count=1 oflag=dsync | grep bytes | awk '{print $7}'
1+0 records in
1+0 records out
536870912 bytes... (2 Replies)
Discussion started by: hce
2 Replies
LEARN ABOUT MINIX
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)