?
Solved

scan files contents to find specific text and output paths to those files and/or replace text

Posted on 2011-09-21
1
Medium Priority
?
434 Views
Last Modified: 2012-05-12
i have ssh access to this web server and I would like to search for presence of specific words in the site files - how can I do that?

we need to re-brand and even though the designers have changed images and the more obvious stuff - I came across a page that had meta tags that were out of date and contained the old company name...

i understand I can use something like this to replace texts, but how can I simply list files that contain the entry?
find . -name "*.html" -type f -exec sed -i 's/text1/text2/g' {} ";"

Open in new window

0
Comment
Question by:ee-gd
[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
1 Comment
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 2000 total points
ID: 36573233
find . -name "*.html" -type f |xargs grep -l "entry"

wmp
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Utilizing an array to gracefully append to a list of EmailAddresses
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

771 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