[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using tar



On Mon, Jun 15, 2020 at 07:30:31PM +0100, mick crane wrote:
yes I see that now
but without hyphen "f" can be anywhere

Yes and no: any of the keys can be in any location, but their arguments must follow the key list in the order that the keys appear. For example:

tar cbf 20 foo.tar /dev/null
tar: Removing leading `/' from member names
tar cbf foo.tar 20 /dev/null
tar: foo.tar: Invalid blocking factor
Try 'tar --help' or 'tar --usage' for more information.

In the first case a foo.tar file is created with a blocking factor of 20, and in the second case the command blew up because the filename is before the blocking factor. With less luck, the swapped arguments wouldn't fail immediately, doing who-knows-what to the system. :)
Reply to: