Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » CommandsRSS Feeds

Search a file for a pattern - grep

Posted By: Jarvia Miller     Category: Unix / Linux / Ubuntu     Views: 9947

This article explains about grep command with an example in unix.

grep command is used to search a file for a pattern in unix.

Syntax of grep Command

grep [- options] pattern filename 

Example of grep command

grep "hello" helloFile.txt

helloFile.txt file contents are as shown below

hello world


Didn't find what you were looking for? Find more on Search a file for a pattern - grep Or get search suggestion and latest updates.

Jarvia Miller
Jarvia Miller author of Search a file for a pattern - grep is from Frankfurt, Germany.
View All Articles

Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

No Comment Found, Be the First to post comment!