Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Your favorite command and mine - grep Post 95044 by wxornot on Friday 6th of January 2006 12:09:37 AM
Old 01-06-2006
Your favorite command and mine - grep

Is their a way to grep for only one occurrence? Here is an example:

given the file information:

BCX 3 5
BCX 23 94
BNG 34 34
BCX 2 09

if I do:

Code:
grep BCX ./file

then i get them all, how can i get just one of them. But let's say there could be a variable number of the desired string. Thanks in advance.
 

4 More Discussions You Might Find Interesting

1. What is on Your Mind?

What's your favorite Xscreensaver?

Out of the 100s of screensavers in xscreensaver, what is your favorite? I think mine is definitely juggle. I can sit and watch that juggler forever. I haven't looked into the code, but it must be amazingly complex to deal with all that's going on. From the random throwing pattern, to the arm... (0 Replies)
Discussion started by: tjlst15
0 Replies

2. What is on Your Mind?

Where Is Your Favorite Continent?

Where is your favorite continent to enjoy life? (14 Replies)
Discussion started by: Neo
14 Replies

3. Fedora

od -c . does not work on mine

# od -c . od: .: read error: Is a directory 0000000 I read the book about shell (Kernighan, Pike) and some exaples (like this) does not work. I read this book carefully (because I think now quickly) even reread to better understand. In this book there is a good example how to see what a... (2 Replies)
Discussion started by: Xcislav
2 Replies

4. What is on Your Mind?

What are Your Favorite Chips? Mine are Doritos Nacho Cheesier!

By far, Doritos Nacho Cheesier are the best tasting chips, well at least too me. Have you tried them? What are your favorite chips? (5 Replies)
Discussion started by: Neo
5 Replies
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)
All times are GMT -4. The time now is 08:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy