Purchase Solution

UNIX COMMANDS

Not what you're looking for?

Ask Custom Question

Please explain GREP

? What the command does, how it could be used
? Important options or switches
? 3 Examples I can use in a UNIX machine

Purchase this Solution

Solution Summary

UNIX COMMANDS are assessed. The command which could not be used is determined. Important options or switches are determined.

Solution Preview

see the attachment

ABOUT GREP
Finds text within a file.
grep is not only one of the most useful commands, but also, mastery of grep opens the gates to mastery of other tools such as awk , sed and perl .
SYNTAX
grep [-b] [-c] [-h] [-i] [-l] [-n] [-s] [-v] [-w] text filenames
-b Precede each line by the block number on which it was found. This can be useful in locating block
-c Print only a count of the lines that contain the pattern.
-h Prevents the name of the file containing the matching line from being appended to that line. Used when searching multiple files.
-i Ignores case.
-l Displays the files that have the text not the text within the file.
-n Precede each line by its line number in the file (first line is 1).
-s Suppress error messages about nonexistent or unreadable files.
-v Specifies you are looking for files that don't contain the text.
-w Search for the expression as a word as if surrounded by < and >.
text The text that you are searching / not searching for. See also below patterns.
filenames the name of the file that you are searching in.
Kinds of Patterns for searching.
. Matches single character.
* Wild character Example C* if found would pull up CC or CAT...
{} Matches any character contained within the bracket.
^ Represents the beginning of the line, so if you did ^T it would search for any sentence starting with a T.
$ Represents the end of the line, so if you did $. then it would pull up any lines that ended with .
Means to take the next ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.