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
Printable View
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
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
but what if i want to extract it to a certain directory like :/usr/local/lib
Move the file to that directory and untar it.
Jeremy
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.
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
thanx stormblazer
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
there are to many ways to do that!! :wink:
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.