Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to generate static html files for all php scripts inside dir:

find . -name "*.php" -exec php {} > {}.html \;

But it just dumps all results to {}.html. How to do it properly? And how to remove '.php' from filenames?

share|improve this question
Please do not cross post between different sites. – Uwe Plonus Jun 5 '13 at 12:06

Got it

find . -name "*.php" | sed "s/\.php//" | xargs -i sh -c 'php {}.php > {}.html'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.