Results 1 to 10 of 11
ok here is what i want to do i want to extract a tar.bz2 to a certain directory using the shell i dont know the command cuz im new...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-10-2005 #1
extract .tar.bz2 command
ok here is what i want to do i want to extract a tar.bz2 to a certain directory using the shell i dont know the command cuz im new
If we couldn't laugh we would all go insane--Jimmy Buffett
Registered Linux user # 376962
- 01-10-2005 #2Linux Guru
- Join Date
- Mar 2003
- Location
- Wisconsin
- Posts
- 1,907
To extract a tar.bz2 file, use the command (note the j option)
To extract a tar.gz file, the the command (note the z option)Code:tar -jxvf filename.tar.bz2
JeremyCode:tar -zxvf filename.tar.gz
Registered Linux user #346571
"All The Dude ever wanted was his rug back" - The Dude
- 01-10-2005 #3
but what if i want to extract it to a certain directory like :/usr/local/lib
If we couldn't laugh we would all go insane--Jimmy Buffett
Registered Linux user # 376962
- 01-10-2005 #4Linux Guru
- Join Date
- Mar 2003
- Location
- Wisconsin
- Posts
- 1,907
Move the file to that directory and untar it.
JeremyRegistered Linux user #346571
"All The Dude ever wanted was his rug back" - The Dude
- 01-10-2005 #5Linux Engineer
- Join Date
- Nov 2004
- Location
- Ft. Polk, LA
- Posts
- 796
Depending on what version of tar you have, it might need the y or I option instead of j. Though they seem to have stuck with j in all the newer releases.
- 01-11-2005 #6Linux Enthusiast
- Join Date
- Jun 2004
- Location
- Windsor, CO
- Posts
- 656
The simplest way to extract to a specific directory:
For a .tar.gz:
For a .tar.bz2:Code:tar -xvzf file.tar.gz -C directory
And it's case sensitive, so make sure you use -C and not -c[/i]Code:tar -xvjf file.tar.bz2 -C directory
Emotions are the key to the soul.
Registered Linux User #375050
- 01-11-2005 #7
thanx stormblazer
If we couldn't laugh we would all go insane--Jimmy Buffett
Registered Linux user # 376962
- 01-12-2005 #8Just Joined!
- Join Date
- Jan 2005
- Posts
- 15
ANother easy way (and the method I always use) to have it extract to a directory:
untar/zip it to get the folder, then use
mv [foldername] [destination]
for example
mv firefox-installer /opt
- 01-12-2005 #9Linux Engineer
- Join Date
- May 2003
- Location
- Greece / Athens
- Posts
- 1,169
there are to many ways to do that!!
Linux For Ever!
- 01-13-2005 #10Just Joined!
- Join Date
- Jan 2005
- Posts
- 15
ONe of the beautiful things about Linux is that there are a dozen ways to do anything, and you can find the way that works with your mind best.



