LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-01-2003, 03:07 PM   #1
linux_guy2003
Member
 
Registered: Jun 2003
Posts: 30

Rep: Reputation: 15
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
 
Old 07-01-2003, 03:14 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
tar -czf archive.tar.gz /path/to/data

z makes tar use gzip you can use a j instead to use bzip2.
 
Old 07-01-2003, 03:22 PM   #3
linux_guy2003
Member
 
Registered: Jun 2003
Posts: 30

Original Poster
Rep: Reputation: 15
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
 
Old 07-01-2003, 03:25 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Code:
tar -czf important.tar.gz /mnt/windows/one /mnwindows/imp/two /mnt/windows/examp/three /home/check
 
Old 07-01-2003, 03:33 PM   #5
linux_guy2003
Member
 
Registered: Jun 2003
Posts: 30

Original Poster
Rep: Reputation: 15
where will this tar archive be created .....in my home dir
thanks
 
Old 07-01-2003, 03:36 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
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
 
Old 07-01-2003, 03:39 PM   #7
linux_guy2003
Member
 
Registered: Jun 2003
Posts: 30

Original Poster
Rep: Reputation: 15
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
 
Old 07-01-2003, 03:44 PM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
That command should do it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
Tar command juanb Linux - General 4 11-03-2005 01:10 AM
tar command? xmdms Linux - General 4 10-07-2004 02:29 PM
tar command.. johnyy Linux - Software 4 12-31-2003 11:54 PM
Tar command satimis Linux - Newbie 3 11-03-2003 11:34 PM


All times are GMT -5. The time now is 10:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration