Tar xfzv does not extract.

I used tar cfvz to create a tar.gz file
I am using tar xfvz to try and open the tar.gz file and nothing happens.
Thanks for the help in advance.

This is way too vague of a request.
Define "nothing happens" and share your tar cfvz .

1 Like

Lose the "z"
tar xf somefile.gz

assuming Linux, tar figures out what decompression to use.

2 Likes

I created a number of files and then created a tar.gz file.
According to the documentation and also video on Linux Academy after
using tar cfzv it should be creating both a zipped file and a tar file.
Only the tar.gz file shows.
In addition no files are extracted either.

'zipped' is not really an expression used in the unix world. Zip files are Windows orientated.

The tar 'c' switch 'creates' a tar file.
The tar 'z' switch 'compresses' that file when it's done (giving rise to a tar.gz file). Just one file.

It is true, however, that some Windows based utilities for 'zip' files can, indeed, read (unzip) unix created files like tar.gz if they are transfered into a Windows environment.
Don't get confused.

And just to add to all that.....some Unix/Linux OS's implement a 'gzip' utility which can manage tar format files.

Also, if you for some reason do need both files (a tar file and a compressed tar file) you could run tar with the 'c' option but not the 'z' option which will create you a tar file.

You could then take a copy of that file before running compress on the tar file converting it to a tar.gz file.

Hope that's clear.

X for extracting
F for file
Z for zipped this is according to Linux Academy
V for verbose
I'm just reiterating what was shown on LA video
I looked up man tar and you are correct that it's compress and not zip.
zip also compresses and archives like Z.
The issue is that the files don't uncompress.
According to the video it's supposed to create 2 files 1.)tar and 2.) tar.gz in addition to the files being uncompressed.
All I'm getting is tar.gz
no tar
no files uncompressed
just tar.gz

--- Post updated at 07:39 PM ---

Also, if you for some reason do need both files (a tar file and a compressed tar file) you could run tar with the 'c' option but not the 'z' option which will create you a tar file.

You could then take a copy of that file before running compress on the tar file converting it to a
Hope that's clear
The instructor used all 4 flags
cfzv so I'm not sure what to think.
He started out with just creating the tar file and then he compressed the tar file in two separate steps.
He then demonstrated how it could be done in one step with all 4 flags.

Yes, well, I'm not clairvoyant and my crystal ball isn't working too well either. As vgersh99 said, can you please provide more detail.

Please post:

The whole command line that you used to create your tar/compressed archive file.
A listing 'ls -l' of the resulting file.
The whole command line that you are using to attempt extraction.
Can we assume extraction is taking place on the same system that created the file???? Which operating system is that?
When you say on extraction 'nothing happens' what do you mean? No error message? Just hangs with no activity? Or what?

Please help us to help you here.

1 Like

Sorry about that.
I thought that I had written Ubuntu.
I used gunzip -k and that worked for 2 separate files.
I was just trying to follow along with the LA video.
I'm a complete newbie so I don't know what is correct or not correct at this point.
If you could suggest a better video source for learning Unix that would be great.

eklinux,
please post the complete cli that you used to create the myFile.tar.gz file.
Also post the output of tar tvf myFile.tar.gz using code tags.
Also provide the cli you to untar commend you use to extract the archived file from myFile.tar.gz that's "not working".

cfvz where 'f' is followed by a filename, .ie 'vz'.

@dodona.....

I find your post confusing. 'vz' is NOT the filename on this command line. v and z are switches as in:

  • c=create
  • f=file <name of archive to be created>
  • v=verbose
  • z=compress

Theoretically, there is nothing wrong with what the OP is trying to do; create an archive and then extract it, but there's obviously something wrong syntactically or some such and until the OP provides the command lines, etc that I and vgersh99 have requested, I'm afraid we're all in the dark.

@hicksd, I had the impression @dodona said that in a lightly humoristic way to make clear that order of the switches is wrong, i.e.

tar zcvf instead of tar cfvz
tar zxvf instead of tar xfvz

And that the result of doing that is using a file named vz

Linux examples:

/tmp#  tar cf vz /tmp
tar: Removing leading `/' from member names
tar: /tmp/vz: file is the archive; not dumped
tar: /tmp/.code-server0.8680082051055391: socket ignored
tar: /tmp/.code-server0.08925957450408695: socket ignored
tar: /tmp/.code-server0.407659618765559: socket ignored
tar: /tmp/.code-server0.7694071641881257: socket ignored
tar: /tmp/.code-server0.17162571589864717: socket ignored
tar: /tmp/.code-server0.2378604208841144: socket ignored
tar: /tmp/.code-server0.5212314932242741: socket ignored
tar: /tmp/.code-server0.5881111008803521: socket ignored

creates file vz

/tmp#  tar cfvz /tmp
tar: Cowardly refusing to create an empty archive
Try 'tar --help' or 'tar --usage' for more information.

Error...

@scrutinizer / @neo......

Thank you for your post guys but........

AFAIR vz will only be interpreted as the archive name if there is whitespace between the cf and vz as in cf vz , which the OP isn't doing.

There is no suggestion that the OP is starting his/her switch string with anything other than a mode switch; c, x, or t, and after that surely the switch order doesn't matter (provided any required arguments for those switches on the command line are given in the same order as the switches).

I guess any/all moderators on here could answer this once the OP posts the full command lines s/he is using.
I repeat, until that happens, we are all in the dark.

2 Likes