1

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

0

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.

0

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 ".".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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