Last active
February 13, 2020 14:52
-
-
Save sheanhoxie/2a95ba858726bec58c7933674209e94c to your computer and use it in GitHub Desktop.
Use when you want to archive a folder without all the heavy files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using exclude | |
============================ | |
--exclude=pattern | |
tar --exclude={*.mp4,*.mov,*.wav,*.wmv,*.mpg,*.mpeg,*.flv,*.avi,*.ogv,*.ogg,*.webm,*.wav,*.mp3,*.wma,*.7z,*.gz,*.tar,*.zip,*.sql,*.jpg,*.gif,*.png,*.svg,*.ico} -cvf output.file.tar input.file | |
Using exclude with text file | |
============================ | |
-X file | |
patterns.txt | |
------------ | |
*.mp4 | |
*.mp3 | |
*.mov | |
...etc. | |
tar -X patterns.txt -cvf output.file.tar input.file | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment