LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   tar command (https://www.linuxquestions.org/questions/linux-newbie-8/tar-command-69336/)

linux_guy2003 07-01-2003 02:07 PM

tar command
 
i have abt 3 gb of data which i have to compress in 1.5 gb of space but all i know is the gzip command...plz tell me how to create a tar archive n compress it ...n also how to uncompress it...also suggest other commnds by wich i can acompress 3gb to abt 1.5gb
thanks

david_ross 07-01-2003 02:14 PM

tar -czf archive.tar.gz /path/to/data

z makes tar use gzip you can use a j instead to use bzip2.

linux_guy2003 07-01-2003 02:22 PM

what is /path/to/data n is archive in archive.tar.gz stand for the name of thae archive..n say i have 10 files n i want to add all of those in gzip format in one tar archive.how is it possible.
eg...i have files..
/mnt/windows/one
/mnwindows/imp/two
/mnt/windows/examp/three
/home/check
i want to have all the files in a file called important.tar.gz(if i have .gz ...it implies files in gzip format)
what should be the command now
thanks

david_ross 07-01-2003 02:25 PM

Code:

tar -czf important.tar.gz /mnt/windows/one /mnwindows/imp/two /mnt/windows/examp/three /home/check

linux_guy2003 07-01-2003 02:33 PM

where will this tar archive be created .....in my home dir
thanks

david_ross 07-01-2003 02:36 PM

IT will be created in the directory you are in. If you want it in your home directory then use:
Code:

tar -czf ~/important.tar.gz /mnt/windows/one /mnwindows/imp/two /mnt/windows/examp/three /home/check

linux_guy2003 07-01-2003 02:39 PM

n say if i have a dir with many subdirs n i want to create a tar archive of the entire dir inludeing all the subdirs...
is it possible
thnx

david_ross 07-01-2003 02:44 PM

That command should do it.


All times are GMT -5. The time now is 10:32 AM.