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 would like to find and gzip/tarball contents of all the folders matching wordpress in my directory, but I am having trouble trying to get the command to work, I thought it was something like

find * | tar -zcvf jdaniel/wp-all.tar.gz 'grep wordpress'

tar: Exiting with failure status due to previous errors

share|improve this question
up vote 0 down vote accepted

Do the search in the find command instead:

find ./ -iname '*wordpress*' | tar -zcvf jdaniel/wp-all.tar.gz

You could also add -type d to the find command, but not sure if that will skip the files in the directories when they are passed to the tar command.

share|improve this answer

If you want to archive all the directories in the current directory whose names include "wordpress", then just use this:

tar -zcvf jdaniel/wp-all.tar.gz *wordpress*

That assumes that you're not interested in directories beginning with ".".

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.