LinuxQuestions.org
Review your favorite Linux distribution.
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 03-07-2002, 11:19 AM   #1
mikeshn
Member
 
Registered: Feb 2002
Posts: 586

Rep: Reputation: 30
tarfile


I have directory Dir1, how can I zip the directory and make it as Dir1.tar?
Thanks
 
Old 03-07-2002, 11:25 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
please refer to man pages for trivial help like using tar, it's a LOT quicker for you...

either way: tar -cvf file.tar file1 file2

Last edited by acid_kewpie; 03-07-2002 at 11:26 AM.
 
Old 03-07-2002, 11:25 AM   #3
Bert
Senior Member
 
Registered: Jul 2001
Location: 406292E 290755N
Distribution: GNU/Linux Slackware 8.1, Redhat 8.0, LFS 4.0
Posts: 1,004

Rep: Reputation: 46
% tar -cvf Dir1

will create

Dir1.tar

but that won't compress it. It will 'tar' it like sticking lots of files together.

% bunzip2 Dir1.tar

will (not surprisingly) make:

Dir1.tar.bz2

you could also use gzip, but I understand that bzip2 uses a better compression algorithm.

Bert
 
Old 09-18-2003, 12:43 PM   #4
mikeshn
Member
 
Registered: Feb 2002
Posts: 586

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by Bert
% tar -cvf Dir1

will create

Dir1.tar

but that won't compress it. It will 'tar' it like sticking lots of files together.

% bunzip2 Dir1.tar

will (not surprisingly) make:

Dir1.tar.bz2

you could also use gzip, but I understand that bzip2 uses a better compression algorithm.

Bert
% bunzip2 Dir1.tar

will (not surprisingly) make:

Dir1.tar.bz2


Will not create .bz2 file, but bzip2 can create new .bz2 file.

bunzip2 can just unzip a file.
 
  


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




All times are GMT -5. The time now is 11:06 AM.

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