Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

How do I write a command that searches the /var/www directory for all files with the name ".htaccess" and outputs the full location/path to each of the .htaccess files into a file?

This would save me a lot of time if this is possible with a unix command. I am running debian, lenny if that helps.

share|improve this question
up vote 4 down vote accepted
find /var/www -name .htaccess > yourfilelist

will do this. For more details, see man find.

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.