On Mon, Jun 15, 2020 at 07:01:32PM +0100, mick crane wrote:
> I think my memory has packed up.
> I thought you put the options after a hyphen with tar ?
> "tar -cfvz archive_file.tgz ./directory_to_archive"
> doesn't work.
> "tar cfvz archive_file.tgz ./directory_to_archive"
> works

Your fundamental problem is that the "-f" option takes an argument.
The -f should be followed by the filename, which is presumably the
thing ending with .tgz.  But the way you've got it written now, the
filename argument of the -f option is "vz".  So you're asking tar to
create an archive file named "vz", and you're using "archive_file.tgz"
and "./directory_to_archive" as the names of the things to place inside
the archive.

What you want is:

  tar czvf archive_file.tgz ./directory_to_archive

Or with the hyphen.  It doesn't matter.

Reply via email to