One requirement is to compress a folder, but to exclude another folder
--exclude command, but execute on Mac
TAR-ZCVF test.tgz test/--exclude *.jpg
Always prompt
Tar:--exclude:cannot stat:no such file or directory
And on Linux does not prompt this error, in the end is why?
Later found that Mac and Linux do not deal with this parameter, through the man tar separately on the Mac and Linux instructions above, found on the MAC for--exclude is explained this way
not process files or directories that match the specified pattern. Note that exclusions take precedence over patterns or filenames specified on the command line.
The first sentence is the interpretation of this command, that is, the meaning of exclusion, the next sentence is the focus, meaning that--exclude to write in front, so mac above exclude a file or folder to write
Tar--exclude *.jpg-zcvf test.tgz test/
And look at the explanation of--exclude in Man tar under Linux.
as a PATTERN
Just explained the use of this command, and did not have a special description of its location, after testing also verified that the--exclude in front and back are in force
Conclusion: Mac and Linux platforms many of the commands are similar, but there are some differences that cannot be taken for granted.
The difference between the tar command for Mac--exclude and the tar command--exclude for Linux