LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 04-16-2008, 12:40 PM   #1
tractng
Member
 
Registered: Nov 2007
Posts: 75

Rep: Reputation: 15
zipping a directory


I am thinking of copying some directories of my current system over to a new system soon.

How do I tar a directory? What is the command. I do know how to unzip a tar file . I don't want to enable samba right now since it is in production.


Btw, its redhat ES4 if that matters.

Thanks,
Tt
 
Old 04-16-2008, 01:05 PM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
tar czf filename.tgz dir-or-files for gzip compression or tar cjf filename.tar.bz dir-or-files for bzip2 compression

you can then move it over via whatever method you prefer (ftp, scp, sftp, nfs, ...)

another option may be rsync (over ssh).
or you can get "complex" by using tar and pushing to the server and extracting "on-the-fly".
example:
Code:
root@oldserver data]# tar czf - . | ssh newserver 'tar xzvf - -C /path/to/where/you/want/files/'
note that the use of '.' is to get everything in the current directory 'data' which has all files on oldserver you want to duplicate to the newserver.


Hope this helps.
 
Old 04-16-2008, 01:55 PM   #3
tractng
Member
 
Registered: Nov 2007
Posts: 75

Original Poster
Rep: Reputation: 15
Thanks man. Do you know what czf option means?


tt
 
Old 04-16-2008, 04:54 PM   #4
gonzojd7
Member
 
Registered: Oct 2005
Location: Florida, USA
Distribution: Ubuntu 8.04, 9.04
Posts: 37

Rep: Reputation: 15
c = create

z = compress

f = filename of compressed file
 
  


Reply



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
Recursively zipping directories AckSed Linux - Newbie 2 10-19-2007 07:29 PM
Zipping a folder Gins Linux - General 9 06-19-2007 05:17 PM
Compressing/Zipping A Directory Wha?Where? Linux - Newbie 4 07-07-2005 09:20 PM
Zipping of files rajesh_b Programming 5 10-27-2004 06:02 AM
Zipping and Taring and ? Goatdemon Linux - Newbie 3 05-22-2002 07:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:04 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
Open Source Consulting | Domain Registration