Solved

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

Posted on 2011-09-21
1
392 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
1 Comment
 
LVL 68

Accepted Solution

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

wmp
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
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.:
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…

762 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

20 Experts available now in Live!

Get 1:1 Help Now