November 21, 2024, 11:04:13 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Extracting files from bz2 , tar.gz, zip, and other archives  (Read 11563 times)

Offline keen_prat

  • Linux Noob !
  • *
  • Posts: 21
Extracting files from bz2 , tar.gz, zip, and other archives
« on: March 05, 2004, 01:58:02 PM »
Hi..
I am not new to linux but I mostly do my work on graphical interface.. So can any one tell me how i can decompress the files in tar.gz , bz2, zip and other archieve in linux using command line ?

Thank you!..

Offline neo

  • Linux Learner
  • ***
  • Posts: 125
    • http://www.investorsgain.com
Extracting files from bz2 , tar.gz, zip, and other archives
« Reply #1 on: March 05, 2004, 05:19:58 PM »
ok u may use tar
the typical syntax is
 
Code: [Select]
tar -xvzf <filename>

Offline keen_prat

  • Linux Noob !
  • *
  • Posts: 21
Extracting files from bz2 , tar.gz, zip, and other archives
« Reply #2 on: March 05, 2004, 06:31:25 PM »
what about bz2 ? will it use the same tar -xvzf <filename> ?

Offline aaa

  • Tux Awared
  • **
  • Posts: 38
Extracting files from bz2 , tar.gz, zip, and other archives
« Reply #3 on: March 05, 2004, 06:32:37 PM »
for tar only: tar -xvf file.tar
for tar.gz : tar -xvzf file.tar.gz
for gzip only: gzip -d file.gz
for bzip2 : bzip2 -d file.bz2
for zip: unzip file.zip

Offline wittyguysuku

  • New Member
  • Posts: 3
Why different formats?
« Reply #4 on: May 10, 2004, 12:54:29 PM »
Hi Frndz,
           Why should we use different file formats?
           Which one is best?

Thanks in advance,
Suku :D

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Extracting files from bz2 , tar.gz, zip, and other archives
« Reply #5 on: May 10, 2004, 01:41:03 PM »
basically files with bz2 are the smallest ie.. having highest compression.. and tar.gz is the most common one..

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
Extracting files from bz2 , tar.gz, zip, and other archives
« Reply #6 on: May 10, 2004, 04:03:51 PM »
Also there is one format know as .tgz which we call a  tarball. It's normally used in Slackware. But in other distros it's still usable.

tgz : gunzip filename.tgz | tar -xvf

Offline wittyguysuku

  • New Member
  • Posts: 3
How to Pack files?
« Reply #7 on: May 11, 2004, 05:38:45 AM »
How to pack some number of files into a single pack?
How to compress the files?

Please give me detailed How to?  :idea:

Thanks,
Suku

Offline yesgokul

  • New Member
  • Posts: 1
Extracting files from bz2 , tar.gz, zip, and other archives
« Reply #8 on: May 12, 2004, 02:17:55 AM »
To compress a folder named fld1 u need to use

tar -cvvjf  fld1.tar.bz2  fld1


Thats it.... pls not its not a necessity to give fld1.tar.bz2, u can give any name but to distinguish it as a bz2 file we name it so.

for tar.gz files

tar -cvvzf fld1.tar.gz fld1

the best place to know more is,

open a terminal & shoot "man tar"

u'll find all the options there.....

Thanks
Gokul