Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hexodus/dbb28212c71066768a8f to your computer and use it in GitHub Desktop.
Save Hexodus/dbb28212c71066768a8f to your computer and use it in GitHub Desktop.
This shows how to tar the current directory except the unwanted subdirectory files.
tar cvpzf backup.tgz --exclude='dir_to_exculde/*' *
tar cvpzf backup.tgz --exclude='dir_to_exculde/*'
--exclude='dir_to_exculde' *
//The last asteric means that the current dir is used. Keep in mind that files with a dot aren't included.
//The secound example excludes also the directory from being included otherwise it would be included as empty one...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment