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

I'm trying to merge my CSS files the following way:

find /Applications/MAMP/htdocs/css/ -type f -name "*.css" -exec cat {} + > ./temporary/css_backend_merged.css

That works great, but I want to include only files that begin with a certain prefix e.g. "include_". Does anyone know how to tweak the find command to do that?

Thanks a lot!

share|improve this question
-name "include_*.css" should do the trick. – Mikael S Dec 26 '09 at 15:38
up vote 4 down vote accepted

Just add the prefix in the -name argument.

find /Applications/MAMP/htdocs/css/ -type f -name "include_*.css" -exec cat {} + > /temporary/css_backend_merged.css
share|improve this answer
thanks, that went perfect indeed – solsol Dec 26 '09 at 15:39

ok guys, just found it myself :)

find /Applications/MAMP/htdocs/css/ -type f -name "incl_*.css" -exec cat {} + > ./temporary/css_backend_merged.css

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.