Search in specific files using grep in Ubuntu


Open your terminal and use following commands.

grep -r –color –include=’*.file_extention’ ‘search_string’ location_where_to search

 

example:

grep -r –color –include=’*.txt ‘pass’ /home/Desktop

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s