How to search inside Text Files in Ubuntu

Today I was working on a WordPress mod and I wanted to find a file which includes a specific class definition. Honestly I am not that good in Ubuntu Command Line Interface. Here is the command you will need to find a text file with your searched keyword

grep -Rs some-title-or-text /some/directory/*

where ‘some-title-or-text’ is whatever you might be looking for, and ‘/some/directory/’ is the directory you want to be looking in. the R option makes it recursive, and the s will suppress any error messages about non-existent files or directories.

Tags: how to, ubuntu, Wordpress

Leave a Reply

You must be logged in to post a comment.