LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Decompressing a .gz file (https://www.linuxquestions.org/questions/linux-general-1/decompressing-a-gz-file-565294/)

Gins 06-29-2007 02:17 AM

Decompressing a .gz file
 
I downloaded the following file. It is a free one.

unrar-linux-x64.gz
This file is a command line freeware x64 Linux UnRar.
http://www.rarlab.com/rar_add.htm

I created a directory named 'Winrar for Linux' and placed the file inside this folder.

-----------------------------------------------------------

[root@ Winrar for Linux]# tar -xvzf 'unrar-linux-x64.gz'
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors
[root@ Winrar for Linux]#
-----------------------------------------------------------
Why couldn't I decompress the file?
It doesn't accept the command ' tar -xvzf ... ' .

b0uncer 06-29-2007 02:25 AM

That tar command would work if the file was a tar archive that was compressed with GZip (.tar.gz). Since it's not a tar archive (there's no '.tar'), you can't use tar :) It's just gzipped file, so use
Code:

gunzip unrar-linux-x64.gz
and it should be un-gzipped.

EDIT: just as an example, here would be the similar commands if the file was just a tar file, or if it was gzipped tar or if it was bzip2'ed tar:

for unrar-linux-x64.tar.gz you would use
Code:

tar -xvzf unrar-linux-x64.tar.gz
The blue v means "verbose output", you'll see what's being done. You can leave it off, and get less output. Red z tells 'tar' that the tar archive is also compressed with gzip, and before untarring the file it should be uncompressed with gunzip.

for unrar-linux-x64.tar.bz2 (compressed using bzip2 instead of gzip) you would use
Code:

tar -xvjf unrar-linux-x64.tar.bz2
Notice the red letter: now there's 'j' instead of 'z', which tells tar that the file is compressed with bzip2 and should be uncompressed with bunzip2 before untarring.

for unrar-linux-x64.tar.Z (compressed, again) you would use
Code:

tar -xvZf unrar-linux-x64.tar.Z
Now notice the capital Z. That's for .Z archives.

for unrar-linux-x64.tar you "only" use
Code:

tar -xvf unrar-linux-x64.tar
Here note that 'x' tells tar to unarchive the file (not archive!), and that the last command option letter is 'f' right after which you must give the filename. Yes, it stands for 'file'.

Gins 06-29-2007 02:35 AM

[root@ Winrar for Linux]# ls
unrar-linux-x64
[root@Winrar for Linux]#

Yes, it worked. It just created a file.
I want to install this program.
Usually I must write 'make' , 'make install' ,etc.
How can I install this program?

b0uncer 06-29-2007 03:00 AM

Code:

file unrar-linux-x64
should tell what kind of file it is. Probably somekind of an "executable" which means you don't install it in any special way, you just run that executable. For example
Code:

./unrar-linux-x64 somefile.rar
If you want to be able to use it without typing the full path in, no matter where you are in the directory tree, you can copy the file under /usr/bin/ for example (because that's one place where the shell automatically checks for executables, if no path is given, just the executable name). You'll need to be root to do that:
Code:

su
cp ./unrar-linux-x64 /usr/bin/
chmod a+rx /usr/bin/unrar-linux-x64
exit

..and that would copy the file to /usr/bin, then set a+rx which means everybody (a) can read (r) and execute (x) the file.

'./configure', 'make' and 'make install' are typical steps to compile a program from source code and install it. In this case you have no source code so you don't have to compile it. 'configure' is actually a script that prepares the source code for compilation on this system; 'make' then compiles the code according to the rules in Makefile, and 'make install' (which usually needs to be run as root) then copies the compiled files into their wanted places in the system so libraries and executables etc. are where they should be for everyone to use.

Gins 06-29-2007 04:55 AM

Thanks bouncer for the replies
It seems you are well aware of all those formats. For me it is a jungle of formats.
--------------------------------------------------------------------------------
[root@Winrar for Linux]# file 'unrar-linux-x64'
unrar-linux-x64: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), for GNU/Linux 2.4.0, stripped
[root@ Winrar for Linux]#

Gins 06-29-2007 05:27 AM

sp2sc-xiso.r37
sp2sc-xiso.r38
sp2sc-xiso.r39
sp2sc-xiso.r40
sp2sc-xiso.r41
sp2sc-xiso.r42
sp2sc-xiso.r43
sp2sc-xiso.rar

I copied a CD on to a folder. It has a lot of 'RAR' files. I want to use this program to open the last file of the above.


Agrouf 06-29-2007 05:47 AM

What is the output of :
unrar-linux-x64 -help

jschiwal 06-29-2007 05:47 AM

First of all, you may have already have had an unrar package available.

To unrar the files, you will need the sp2sc-xiso.r00 - sp2sc-xiso.r36 files as well. Then you run the command:
unrar x sp2sc-xiso.rar.

Sometimes the archives look like file.part01.rar .. file.part09.rar. If that is the case, use "unrar x file.part01.rar".

Gins 06-29-2007 05:54 AM

[root@ Winrar for Linux]# cp ./unrar-linux-x64 /usr/bin/
[root@ Winrar for Linux]# chmod a+rx /usr/bin/unrar-linux-x64
[root@ Winrar for Linux]# exit
exit
[Nissanka@~]$
The above worked fine.
---------------------------------------------------------------------
jschiwal
I am still running Fedora Core5. How do I know whether I have the unrar package?
If it is on my system, how do I use it.

Gins 06-29-2007 05:58 AM

Agrouf
Here is the output:
-------------------------------------------------------
[Nissanka@ ~]$ unrar-linux-x64 -help

UNRAR 3.30 beta 4 freeware Copyright (c) 1993-2004 Eugene Roshal

Usage: unrar <command> -<switch 1> -<switch N> <archive> <files...>
<@listfiles...> <path_to_extract\>

<Commands>
e Extract files to current directory
l[t,b] List archive [technical, bare]
p Print file to stdout
t Test archive files
v[t,b] Verbosely list archive [technical,bare]
x Extract files with full path

<Switches>
- Stop switches scanning
ad Append archive name to destination path
ap<path> Set path inside archive
av- Disable authenticity verification check
c- Disable comments show
cfg- Disable read configuration
cl Convert names to lower case
cu Convert names to upper case
dh Open shared files
ep Exclude paths from names
f Freshen files
idp Disable percentage display
ierr Send all messages to stderr
inul Disable all messages
kb Keep broken extracted files
o+ Overwrite existing files
o- Do not overwrite existing files
ow Save or restore file owner and group
p[password] Set password
p- Do not query password
r Recurse subdirectories
ri<P>[:<S>] Set priority (0-default,1-min..15-max) and sleep time in ms
ta<date> Process files modified after <date> in YYYYMMDDHHMMSS format
tb<date> Process files modified before <date> in YYYYMMDDHHMMSS format
tn<time> Process files newer than <time>
to<time> Process files older than <time>
ts<m,c,a>[N] Save or restore file time (modification, creation, access)
u Update files
v List all volumes
ver[n] File version control
vp Pause before each volume
x<file> Exclude specified file
x@ Read file names to exclude from stdin
x@<list> Exclude files in specified list file
y Assume Yes on all queries
[Nissanka@ ~]$
---------------------------------------------------

Gins 06-29-2007 07:40 AM

Our friend jschiwal touched on the subject of unrar.
I don't know about it.
Please tell me.
There are 44 files altogether.

-------------------------------------------------------------
sp2sc-xiso.r00
sp2sc-xiso.r01
sp2sc-xiso.r02

...........
...........

sp2sc-xiso.r42
sp2sc-xiso.r43
sp2sc-xiso.rar

druuna 06-29-2007 11:14 AM

Hi,

Jschiwal already told you how to do it in post #8................

unrar x sp2sc-xiso.rar

Or if unrar is named a bit different: unrar-linux-x64 x sp2sc-xiso.rar
This information is also present in the output you posted in post #10

Gins 06-29-2007 01:27 PM

Thanks druuna. I remember you very well. You have been with us for a long time. I am proud of your prowess in Open Source.


---------------------------------------
[root@ Windows2]# unrar x sp2sc-xiso.rar

UNRAR 3.60 freeware Copyright (c) 1993-2006 Alexander Roshal


Extracting from sp2sc-xiso.rar

Extracting sp2sc-xiso.bin

Extracting from sp2sc-xiso.r00

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r01

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r02

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r03

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r04

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r05

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r06

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r07

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r08

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r09

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r10

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r11

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r12

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r13

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r14

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r15

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r16

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r17

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r18

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r19

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r20

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r21

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r22

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r23

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r24

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r25

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r26

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r27

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r28

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r29

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r30

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r31

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r32

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r33

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r34

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r35

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r36

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r37

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r38

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r39

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r40

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r41

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r42

... sp2sc-xiso.bin

Extracting from sp2sc-xiso.r43

... sp2sc-xiso.bin OK
Extracting sp2sc-xiso.cue OK
Extracting sp2sc-xiso.nfo OK
All OK
[root@ Windows2]#

--------------------------------------------------
The aim is to burn a file to get an .iso file; because .iso is a bootable one. When I have it on a CD, I could restart the computer with the CD which has the .iso file. I am using K3b program for burning.

I believe the 'sp2sc-xiso.bin' is the correct one. When I burnt it, I would get an .iso file.
Please tell me if I am wrong.


[root@ Windows2]# ls -l sp2sc-xiso.bin
-rw-r--r-- 1 root root 736655808 Mar 15 09:54 sp2sc-xiso.bin
[root@ Windows2]#

jschiwal 06-29-2007 01:33 PM

When you go to burn an image in k3b, click on the drop down box on the filetype filter, and select "cue files". The cue file will be used then to load in and burn the .bin file.

druuna 06-29-2007 01:41 PM

Hi,

First: Would you please stop posting irrelevant stuff (in this case the [long] output of the unrar command). You've been asked this before.
What's the point in showing us that it worked, just tell us it did and (if needed) ask the next question.

Ok, about burning the bin file: You state that you use k3b, if that is the case, nothing special needs to be done. Just start k3b and burn the bin file to disk.

Hope this helps.


All times are GMT -5. The time now is 07:49 PM.