I have a folder structure like so:
file1 file2 file3 file4 folder1 folder2
Without writing each file, how can I tar zip all the files and folders, except file1 and folder1?
You can use --exclude=pattern option which prevents any file or member whose name matches the wildcard (pattern) from being operated on. For example, to create an archive with all the contents of the directory
Assuming the main folder that contains all the files/folders you want to compress is located at
If you're currently inside the
Or, if you're inside the directory you want to compress (in this case,
Note the dot at the end of the second option.
Also note that I used