Skip to main content
word wrap for readability
Source Link
ilkkachu
  • 147.9k
  • 16
  • 268
  • 441

In a shell pipeline, I compose a tar archive from a selection of files under a directory, taking the list of files from stdin, and write the archive to stdout. When I run tar like this:

tar cCTf directory - -

everything is fine. But when I try to run it like this:

tar cTCf - directory -

tar does not find the files, and I get the following error message:

tar: The following options were used after any non-optional  
arguments in archive create or update mode.  These options  
are positional and affect only arguments that follow them.   
Please, rearrange them properly.
tar: -C ‘directory' has no effect

What is wrong with the second command?

I am running GNU tar 1.34.

In a shell pipeline, I compose a tar archive from a selection of files under a directory, taking the list of files from stdin, and write the archive to stdout. When I run tar like this:

tar cCTf directory - -

everything is fine. But when I try to run it like this:

tar cTCf - directory -

tar does not find the files, and I get the following error message:

tar: The following options were used after any non-optional arguments in archive create or update mode.  These options are positional and affect only arguments that follow them.  Please, rearrange them properly.
tar: -C ‘directory' has no effect

What is wrong with the second command?

I am running GNU tar 1.34.

In a shell pipeline, I compose a tar archive from a selection of files under a directory, taking the list of files from stdin, and write the archive to stdout. When I run tar like this:

tar cCTf directory - -

everything is fine. But when I try to run it like this:

tar cTCf - directory -

tar does not find the files, and I get the following error message:

tar: The following options were used after any non-optional 
arguments in archive create or update mode.  These options 
are positional and affect only arguments that follow them. 
Please, rearrange them properly.
tar: -C ‘directory' has no effect

What is wrong with the second command?

I am running GNU tar 1.34.

deleted 7 characters in body
Source Link
toomas
  • 170
  • 7

In a shell pipeline, I compose a tar archive from a selection of files under a directory, taking the list of files from stdin, and writingwrite the archive to stdout. When I run tar like this:

tar cCTf directory - -

the command runs normallyeverything is fine. But when I try to run it like this:

tar cTCf - directory -

tar does not find the files, and I get the following error message:

tar: The following options were used after any non-optional arguments in archive create or update mode.  These options are positional and affect only arguments that follow them.  Please, rearrange them properly.
tar: -C ‘directory' has no effect

What is wrong with the second command?

I am running GNU tar 1.34.

In a shell pipeline, I compose a tar archive from a selection of files under a directory, taking the list of files from stdin, and writing the archive to stdout. When I run tar like this:

tar cCTf directory - -

the command runs normally. But when I try to run it like this:

tar cTCf - directory -

tar does not find the files, and I get the following error message:

tar: The following options were used after any non-optional arguments in archive create or update mode.  These options are positional and affect only arguments that follow them.  Please, rearrange them properly.
tar: -C ‘directory' has no effect

What is wrong with the second command?

I am running GNU tar 1.34.

In a shell pipeline, I compose a tar archive from a selection of files under a directory, taking the list of files from stdin, and write the archive to stdout. When I run tar like this:

tar cCTf directory - -

everything is fine. But when I try to run it like this:

tar cTCf - directory -

tar does not find the files, and I get the following error message:

tar: The following options were used after any non-optional arguments in archive create or update mode.  These options are positional and affect only arguments that follow them.  Please, rearrange them properly.
tar: -C ‘directory' has no effect

What is wrong with the second command?

I am running GNU tar 1.34.

Source Link
toomas
  • 170
  • 7

order of (GNU) tar arguments under old style syntax?

In a shell pipeline, I compose a tar archive from a selection of files under a directory, taking the list of files from stdin, and writing the archive to stdout. When I run tar like this:

tar cCTf directory - -

the command runs normally. But when I try to run it like this:

tar cTCf - directory -

tar does not find the files, and I get the following error message:

tar: The following options were used after any non-optional arguments in archive create or update mode.  These options are positional and affect only arguments that follow them.  Please, rearrange them properly.
tar: -C ‘directory' has no effect

What is wrong with the second command?

I am running GNU tar 1.34.