x

GREP command in Unix

PREV     NEXT

GREP command in UNIX is used to find the whether the search criteria is available in the file and if the search criteria matches then it will print the matching lines.


Ex:

The below example shows on how to search the keyword when we are not sure of the file name. In the place of file name if we provide * key, then it will search the keyword from all the files under the directory and print the file name it matches along with the matching lines.

Grep -i command:

This command is as like “grep” but the “-i” ignores the case sensitive. That means irrespective of uppercase or lowercase letter it will search and print the matching lines.

Ex:



Like it? Please Spread the word!