Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 250
  • Last Modified:

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

Hi Guys,

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

thanks
0
gg234
Asked:
gg234
1 Solution
 
ravenplCommented:
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
done
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now