How to use shell command for tar list of files and folders with exceptions

How to deactivate a list of files and folders (all in one directory) with the exception of one directory (which contains a huge amount of data)

+3
source share
2 answers

tar --exclude=PATTERN xvzf nameof.tar.gz ./*

PATTERN may be a directory name. GNU tar.

+7
source

I think this may depend on your version of tar. You can use "man tar" or "tar -help" to find out the details of your version. But the options I found are as follows:

tar -X filename: excludes everything listed in this text file tar --exclude = pattern: excludes everything that matches the pattern

0
source

Source: https://habr.com/ru/post/1697589/


All Articles