Solved

Looking for text inside ALL files in a directory

Posted on 2006-10-27
3
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Fetching data from Multiple Linux Server using Shell Scripting 55 178
ifconfig 4 92
linux 13 101
AWS Linux EC2 question on group 7 10
rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 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