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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-01-2003, 02:07 PM
|
#1
|
Member
Registered: Jun 2003
Posts: 30
Rep:
|
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
|
|
|
07-01-2003, 02:14 PM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
tar -czf archive.tar.gz /path/to/data
z makes tar use gzip you can use a j instead to use bzip2.
|
|
|
07-01-2003, 02:22 PM
|
#3
|
Member
Registered: Jun 2003
Posts: 30
Original Poster
Rep:
|
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
|
|
|
07-01-2003, 02:25 PM
|
#4
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Code:
tar -czf important.tar.gz /mnt/windows/one /mnwindows/imp/two /mnt/windows/examp/three /home/check
|
|
|
07-01-2003, 02:33 PM
|
#5
|
Member
Registered: Jun 2003
Posts: 30
Original Poster
Rep:
|
where will this tar archive be created .....in my home dir
thanks
|
|
|
07-01-2003, 02:36 PM
|
#6
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
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
|
|
|
07-01-2003, 02:39 PM
|
#7
|
Member
Registered: Jun 2003
Posts: 30
Original Poster
Rep:
|
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
|
|
|
07-01-2003, 02:44 PM
|
#8
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
That command should do it.
|
|
|
All times are GMT -5. The time now is 06:55 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|