tar: Error opening archive: Failed to open 'wekaUT.tar.gz' in Command Line Windows 10 - command-line

I want to extract a tar file that I obtained at tar.gz file. However, when I try: tar -xzvf wekaUT.tar.gz
I get the following error:
tar: Error opening archive: Failed to open 'wekaUT.tar.gz'
I see the file in my directory as wekaUT.tar.gz.
Any help would be much appreciated.

Just commenting here as I ran into the same issue. In windows "tar xfv .tar.gz" should work if you open the command prompt as administrator.

In my case, I was building the file to untar dynamically using a variable like
tar -xzvf "$SOME_TEMP_DIR/a_cool_file.tar.gz"
And encountered this error because of the quotes. If I updated it to:
tar -xzvf $SOME_TEMP_DIR/a_cool_file.tar.gz
It worked :)

In windows compand promt use quotation marks ("") when specifying the path. It will work properly
Exaple : tar -xvzf "C:/PATH/TO/FILE/FILE-NAME.tar.gz" -C "C:/PATH/TO/FOLDER/EXTRACTION"
tar -xvzf "C:/PATH/TO/FILE/FILE-NAME.tar.gz"

Related

No such file or directory cygwin + rsyc

I am trying to send a file in cygwin commandline with rsync and openssh.
So the command I'm using is rsync -P -e "ssh -p 2222" deborahtrez#209.6.204.90:/home/dell/cygdrive/c/Users/dell/Videos/Movavi/installation_tutorial.mp4
Then it asks for my password, which I enter. I press ENTER and I always get returned No such file or directory
The file path to my video "installation_tutorial.mp4" is in C:\Users\dell\Videos\Movavi so the full path becomes C:\Users\dell\Videos\Movavi\installation_tutorial.mp4. So this is what I have tried so far.
Please, what am I doing wrong? Is it my file path? If so, what is the correct file path that i should be using? Help!
The path is wrong. The best way to convert from Windows to Posix is to use cygpath
$ cygpath -u 'C:\Users\dell\Videos\Movavi\installation_tutorial.mp4'
/cygdrive/c/Users/dell/Videos/Movavi/installation_tutorial.mp4

Untar file in Ubuntu 16.04

I want to untar a file in Ubuntu but as I enter this command
tar xvf filename.tgz
I receive the following errors:
tar: filename.tgz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
How can I solve this?
Use cd to go into the directory on which the file.tgz file is located and then run the below command to extract its content.
tar -zxvf file.tgz

Cannot unpack .tgz mongodb distribution on OSX

I grab the tgz file via
curl -O https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-2.6.12.tgz
yes I want mongodb version 2.6.12... :(
and I try to unzip it using:
tar -xvzf mongodb-osx-ssl-x86_64-2.6.12.tgz
but I get:
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
anybody know what might be wrong?
The file didn't download property, so even though it was a .tgz file on the filesystem it was incomplete or corrupted. To get a proper download I had to drop the ssl
before:
curl -O https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-2.6.12.tgz
after:
curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.6.12.tgz
then unpacking with tar worked. √

Cloud Ubuntu server(Ubuntu 16.04) tar: This does not look like a tar archive

I used the cloud Ubuntu server(Ubuntu 16.04).
I used the following command to get data following the instruction from this link(https://pjreddie.com/darknet/yolo/ Get The Pascal VOC Data ).
The Linxu command is shown as following:
curl -O http://pjreddie.com/media/files/VOCtrainval_11-May-2012.tar
curl -O http://pjreddie.com/media/files/VOCtrainval_06-Nov-2007.tar
curl -O http://pjreddie.com/media/files/VOCtest_06-Nov-2007.tar
tar xf VOCtrainval_11-May-2012.tar
but there is error:
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
and
$ file VOCtest_06-Nov-2007.tar
VOCtest_06-Nov-2007.tar: HTML document, ASCII text, with CRLF line terminators
Could you tell me how to solve it, thanks!
ah, this may have resulted from the move from http -> https. I fixed it on the site, replace http with https and it'll work

Windows command line tar "cannot connect to d: resolve failed" with Chef Knife

Using Windows Command line with cygwin, chef and ruby installed. When trying
knife cookbook site install mysql
returns the following error
Begin output of tar zxvf D:/path/to/chef-repo/cookbooks/mysql.tar.gz
STDOUT:
STDERR: tar<child>: Cannot connect to D: resolve failed
gzip: stdin: undexpected end of file
tar: Child returned status 128
tar: Error is not recoverable: exiting now</code>
How can I remedy this issue? I can manually unzip using
tar zxvf mysql.tar.gz
but this is less than ideal. I believe this has to do with the colon in filename but how can I change that in the knife or chef preferences?
The reason is that tar interprets colons (:) in file names as meaning it is a file on another machine. You can disable this behavior by using the flag --force-local.
This is from an answer from here.
I don't know a complete answer but have been seeing this on Linux machines lately:
$ date > today
$ tar -czf - today > to:day.tgz
$ tar -tzf to:day.tgz
ssh: connect to host to port 22: Connection refused
tar (child): to\:day.tgz: Cannot open: Input/output error
tar (child): Error is not recoverable: exiting now
gzip: stdin: unexpected end of file
tar: Child returned status 2
tar: Error is not recoverable: exiting now
$ tar -tzf - < to:day.tgz
today
$
It appears that tar wants to do some sort of remote file processing because of the colon in the file name and you can fake it out by using some form of redirection or piping - for both reading and writing a tarball. I would still like to find an option or something to tell tar not to behave this way.
Will the tar command work if ran from cmd? Also what if the output is to a local drive. Something else try this,
tar zxvf "D:/path/to/chef-repo/cookbooks/mysql.tar.gz"