• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 414
  • Last Modified:

In all sub-directories gzip all *.html and *.php files

Hi,

in all sub-directories gzip all *.html and *.php files

How do i do that in linux
0
gg234
Asked:
gg234
1 Solution
 
xDamoxCommented:
Hi,

You could do the following:

find /var/www -name *.htm -exec gzip -9 {} \; && find /var/www -name *.php -exec gzip -9 {} \;  

Replace /var/www path with tha path of where you want to start.
0
 
gg234Author Commented:
i want to gzip the files menctioned files in all subdirectories
0
 
ravenplCommented:
The above does, and just little fix/improvement to have just one call
find /var/www -type f -name '*.html' -o -name '*.php' -exec gzip -9 {}\;
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

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