I'm trying to create tar.gz file using the following command:
sudo tar -vcfz dvr_rdk_v1.tar.gz dvr_rdk/
It then start to create files (many files in folder), but then I get the following error:
tar: dvr_rdk_v1.tar.gz: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
I don't see any description of this error, what does it mean?
Best Answer
Remove
-
fromvcfz
options.tar
does not need hyphen for options.With a hyphen, the argument for the
-f
option isz
. So the command is in effect trying to archivedvr_rdk_v1.tar.gz
anddvr_rdk
into an archive calledz
. Without the hyphen, the semantics of the options changes, so that the next argument on the command line, i.e. your archive's filename, becomes the argument to thef
flag.Also check your write permission to the directory from which you are executing the command.