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 want to remove a folder when I'm creating a tar.gz file as it's for a backup and it takes too much space and is not required

I am using the following command;

tar -cvzf /home/backups/$STAMP-Earth.tar.gz /home/bukkit/

I do not want to include "/home/bukkit/plugins/dynmap" when creating the tar.gz

Any help would be appreciated.

share|improve this question
zip != tar. Please edit s/zip/tar. – psusi Jan 8 '12 at 18:17
up vote 6 down vote accepted

You can use the following option to eliminate the folder/file you want.


Your command becomes like:

tar -cvzf /home/backups/$STAMP-Earth.tar.gz --exclude=plugins/dynmap /home/bukkit/
share|improve this answer
Thanks works perfectly! – Josip Gòdly Zirdum Jan 8 '12 at 17:55

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.