find and replace

Posted on 2009-04-26
Last Modified: 2013-12-16
Hi All

I want to search the whole filesystem for and replace it with another email address.

Any ideas on how to do this?
Question by:willa666
    LVL 48

    Expert Comment

    find / -type f -exec grep -l '' {} \; | xargs -i sed -i 's/' {}
    LVL 48

    Accepted Solution

    might be easier to read as a code snippet
    find / -type f -exec grep -l '' {} \; | xargs -i sed -i 's/' {}

    Open in new window

    LVL 1

    Author Comment

    Hi Tintin

    Kewl and if i want to limit the search replace to a certain directory i can just do

     find /var/www/vhosts/ -type f....


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
    Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
    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…
    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.

    745 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

    14 Experts available now in Live!

    Get 1:1 Help Now