Originally Posted by lleb
thank you roger_heslop, i was just getting ready to report i figured it out. i had the syntax wrong. needed exactly like you posted the -X or --exclude-from=FOO needs to be after the file name to tar.
That is not really true. Your issue was not that it came before the filename, but between the -f option and the filename.
tar cvjf filename files-to-tar
is nothing more than the short form for
tar -c -v -j -f filename files-to-tar
In the long form it seems to be more clear that filename
is a parameter for the -f option. So it is perfectly valid to
put the -X option before the filename, but just not between the -f option and its parameter, the filename.
For example, these are valid ways to do it:
tar -X excludefile -c -v -j -f filename files-to-tar
tar -X excludefile cvjf filename files-to-tar
tar cvjX excludefile -f filename files-to-tar
tar cvjf filename -X excludefile files-to-tar
tar cvjf filename files-to-tar -X excludefile
In short, the -f option, in all its allowed forms, always expects a filename after it, in the same way that the -X option always expects the excludefile after it.