We help IT Professionals succeed at work.

Looking for text inside ALL files in a directory

hankknight
hankknight asked
on
Medium Priority
226 Views
Last Modified: 2010-04-20
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!
Comment
Watch Question

Commented:
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
Commented:
sorry add

grep myscript.cgi * -R

the -R is for recursively looking at all the subdirectories as well

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thanks!

I have posted a related question here:
http://www.experts-exchange.com/Operating_Systems/Linux/Q_22039765.html
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.