D
D
Dwellss2019-10-11 22:22:58
linux
Dwellss, 2019-10-11 22:22:58

What's the problem with tar?

I suddenly had a problem. All my life I made an archive from MC with the command:
tar cpvzf files.tar.gz *
And today, after entering this command, the following error appeared:

tar cpvzf files.tar.gz *
tar: You may not specify more than one '-Acdtrux', '--delete' or '--test-label' option
Try 'tar --help' or 'tar --usage' for more information.

How to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2019-10-12
@Dwellss

Most likely there is a file in the directory that looks like a tar option.
Why this happens:
1. TAR, as a rather old tool, supports the old BSD format (without hyphens), so, for example, a file named x can be perceived as an extract command
2. Shell globbing (asterisk) is expanded not by a tar, but by a shell, before the team leaves the tar.
3. Aleksey Ten correctly suggests that the problem is most likely with the file, and it is solved by ./* or . - in this case, the files in the current directory will not be added as filename, but as ./filename and tar will see them correctly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question