§      Copy all *.php and *.html files that contain the word 'security' into a seperate directory

Posted on 2006-05-22
Last Modified: 2010-04-22
Hi Guys,

Copy all *.php and *.html files that contain the word 'security' into a seperate directory using shell script or through command

Question by:gg234
    1 Comment
    LVL 43

    Accepted Solution

    find /source/dir -type f -name '*.html' -o -type f -name '*.php' | while read fn; do
     grep -q 'security' "$fn" && cp -f "$fn" /destination/dir

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    script 11 130
    Problem to command 8 84
    read a word from a file in linux shell script 4 63
    how does yum update work 2 38
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    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…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    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

    16 Experts available now in Live!

    Get 1:1 Help Now