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

i have a directory structure with files like


(with 1000's of files. gal1 and 1.jpg obviously change)

all i want to back up are everything apart from the ones in /full/. so basically, i need to backup:


but exclude


how can i write a .tar.gz to do this?

thank you

share|improve this question

migrated from Jul 10 '10 at 0:08

This question came from our site for system and network administrators.

1 Answer 1

From the directory containing the files directory:

tar -zcf files.tgz files --exclude="files/pics/*/full"
share|improve this answer
Maybe: tar -zcf files.tgz files/pic/gal1 --exclude="files/pics/*/full" to match OP's requirement – jim mcnamara Jul 12 '10 at 16:42

Your Answer


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