The grep command can be used to search every file in a directory for a string of text. In this example, every file below the opt directory is searched for the text Hello World.
The -Rnw option is the short version of --dereference-recursive, --line-number, and --word-regex. This searches every file below the directory, adds the line number to the output, and only returns results that match the entire word searched.
The -ie option is the short version of --ignore-case and --regexp. This makes sure the search is not case sensitive.
~]# grep -Rnw '/opt' -ie 'hello world'