Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Looking for text inside ALL files in a directory

Posted on 2006-10-27
3
Medium Priority
?
203 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
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 find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month9 days, 19 hours left to enroll

926 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