Solved

Looking for text inside ALL files in a directory

Posted on 2006-10-27
3
193 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!
0
Comment
Question by:hankknight
  • 2
3 Comments
 
LVL 14

Expert Comment

by:ygoutham
ID: 17818609
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
 
LVL 14

Accepted Solution

by:
ygoutham earned 500 total points
ID: 17818615
sorry add

grep myscript.cgi * -R

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

Author Comment

by:hankknight
ID: 17818643
Thanks!

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

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now