Page 1 of 1

Unzipping tar.gz files

Posted: Sat Feb 01, 2014 9:41 pm
by Loonhaunt
Hello I am trying to unzip a downloaded file ftdi_sio.tar.gz
I have used these option that I got from a comment somewhere:
tar xvf ftdi_sio.tar.gz
tar ftdi_sio.tar.gz
tar xvzf ftdi_sio.tar.gz
return"tar: Child returned status 1
tar: error isn not recoverable: exiting now"

Thanks much, pretty new to linux and command line file operation

Dave

Re: Unzipping tar.gz files

Posted: Sat Feb 01, 2014 10:05 pm
by DeeJay
Looking at http://www.ftdichip.com/Drivers/VCP.htm, there does not seem to be a driver for the ARM architecture in the RPi. Are you sure the driver you are trying to install is appropriate for your operating system?

If you are determined to proceed, try using gunzip to unpack the .gz archive, and then tar to extract the files from the resulting tar file.

Re: Unzipping tar.gz files

Posted: Sun Feb 02, 2014 2:46 am
by Loonhaunt
Hmm.

If that is the case what does one use to control an ftdi(the lack of ARM) chip with the raspberry pi and consequently talk to an xBee?

Re: Unzipping tar.gz files

Posted: Sun Feb 02, 2014 6:18 am
by sdjf
Cannot answer your question about controlling that device but, just for the record, if you want to unzip a gzip file, you would use gunzip.

gunzip filename.gz


and if it is a tar.gz file, I do it the long way instead of getting fancy with options:

gunzip filename.tar.gz
tar xvf filename.tar

Re: Unzipping tar.gz files

Posted: Sun Feb 02, 2014 7:23 am
by rpdom
If you are using Raspbian, the ftdi_sio driver is already installed. It is a module called (not surprisingly) ftdi_sio.ko

It should get automatically loaded when you plug the device in to the USB port.

In Linux most (but not all) of the drivers you will need are either built in to the kernel or available as modules which will either be automatically loaded when the device is detected or have to be told to be loaded.

It has been a long time since I've needed to install any other drivers and in that case it was a case of downloading source, making a few tweaks for the unusual device I was using (PCMCIA floppy drive), compiling and installing.

Re: Unzipping tar.gz files

Posted: Sun Feb 02, 2014 9:14 pm
by DougieLawson
Why not use the simple options

If it's tar.bz2 then use tar -xjvf filename.tar.bz2
If it's tar.gz then use tar -xzvf filename.tar.gz
if it's tgz then use tar -xzvf filename.tgz

In each case tar runs the appropriate unzip program and pipes the output into tar.

-x means extract
-v mean list things as they're untarred (can be a bit noisy on a large tarball).
-f gives the filename for input

Re: Unzipping tar.gz files

Posted: Sun Feb 02, 2014 9:30 pm
by Loonhaunt
So I did everyone of those letter for letter and each one returned a different error message. With that I am guessing the something did not work with the download. However if I just unzip the file using the file manager in startx I can see the four files and they have mass so I don't know what could be missing.

DB
DougieLawson wrote:Why not use the simple options

If it's tar.bz2 then use tar -xjvf filename.tar.bz2
If it's tar.gz then use tar -xzvf filename.tar.gz
if it's tgz then use tar -xzvf filename.tgz

In each case tar runs the appropriate unzip program and pipes the output into tar.

-x means extract
-v mean list things as they're untarred (can be a bit noisy on a large tarball).
-f gives the filename for input

Re: Unzipping tar.gz files

Posted: Sun Feb 02, 2014 10:07 pm
by gkreidl
Loonhaunt wrote:So I did everyone of those letter for letter and each one returned a different error message. With that I am guessing the something did not work with the download. However if I just unzip the file using the file manager in startx I can see the four files and they have mass so I don't know what could be missing.
If your own quote was right, you didn't have the "-" in front of the options string.

Re: Unzipping tar.gz files

Posted: Sun Feb 02, 2014 10:36 pm
by Loonhaunt
Yes but did the whole run of experiments over again with the - . Still got the same results.

Dave

Re: Unzipping tar.gz files

Posted: Sun Feb 02, 2014 11:37 pm
by jojopi
The "-" is optional for tar options. (More correctly, either the standard option syntax or the historic bundled form are accepted. In bundled form, all the characters of the first argument are options, and all the values for the options come in later arguments. In option form, options can come anywhere, but values must immediately follow their options. So "tar fx file.tar" works, whereas "tar -fx file.tar" mistakes "x" as the filename for "-f".)

The error message in the original post is incomplete, but most likely the file was not downloaded correctly. The only other reason for the third command to fail is if gzip is broken on the system.
DougieLawson wrote:If it's tar.bz2 then use tar -xjvf filename.tar.bz2
If it's tar.gz then use tar -xzvf filename.tar.gz
In recent versions you can use "tar -xavf" to autodetect the compression based on the extension. This avoids the need to remember that there is also -J for .xz and -Z for .Z, and several others.

Re: Unzipping tar.gz files

Posted: Sun Feb 02, 2014 11:40 pm
by DougieLawson
jojopi wrote:In recent versions you can use "tar -xavf" to autodetect the compression based on the extension. This avoids the need to remember that there is also -J for .xz and -Z for .Z, and several others.
Thanks for sharing that. I now have to retrain my fingers to type an 'a' where a 'j', 'J', 'z' or 'Z' belongs.

Re: Unzipping tar.gz files

Posted: Mon Feb 03, 2014 1:53 am
by Loonhaunt
jojopi wrote:The "-" is optional for tar options. (More correctly, either the standard option syntax or the historic bundled form are accepted. In bundled form, all the characters of the first argument are options, and all the values for the options come in later arguments. In option form, options can come anywhere, but values must immediately follow their options. So "tar fx file.tar" works, whereas "tar -fx file.tar" mistakes "x" as the filename for "-f".)

The error message in the original post is incomplete, but most likely the file was not downloaded correctly. The only other reason for the third command to fail is if gzip is broken on the system.
DougieLawson wrote:If it's tar.bz2 then use tar -xjvf filename.tar.bz2
If it's tar.gz then use tar -xzvf filename.tar.gz
In recent versions you can use "tar -xavf" to autodetect the compression based on the extension. This avoids the need to remember that there is also -J for .xz and -Z for .Z, and several others.
My suspicion is that the download did not go well.

Re: Unzipping tar.gz files

Posted: Mon Feb 03, 2014 5:24 am
by ShiftPlusOne
Strange, I've been using

Code: Select all

tar xvf file
for a very long time for any archived tar file without specifying any additional flags without any problems.

Re: Unzipping tar.gz files

Posted: Mon Feb 03, 2014 1:47 pm
by Loonhaunt
I have to try that one. I will report back later.

Re: Unzipping tar.gz files

Posted: Mon Feb 03, 2014 3:22 pm
by jojopi
ShiftPlusOne wrote:tar xvf file
Oh wow! That behaviour is fully documented and actually predates --auto-compress.

So you only need -a when creating archives, and you only need -z -j -J when dealing with pipes.