Looking for text inside ALL files in a directory

Hello, before I delete a file I want to confirm that NONE of my scripts point to it.

All my scripts are in this directory (and subfolders of this directory):
        /home/myname/mydir/scripts/

The name of the file I want to look for is:
        myscript.cgi

How can I make sure that the text "myscript.cgi" does NOT appear inside of any files in my directory?

Thanks!
LVL 16
hankknightAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ygouthamConnect With a Mentor Commented:
sorry add

grep myscript.cgi * -R

the -R is for recursively looking at all the subdirectories as well
0
 
ygouthamCommented:
just try to execute the following command after you do a

cd /hom/myname/mydir/scripts

grep myscript.cgi *

the grep command looks for the particular word and gives a list of matching files that contain the text searched for.

goutham
0
 
hankknightAuthor Commented:
Thanks!

I have posted a related question here:
http://www.experts-exchange.com/Operating_Systems/Linux/Q_22039765.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.