How do I compress a directory?

1


Question:

I'm trying to compress a directory and ftp it to a windows ftp.

I have tried every tar command I can find to compress a directory. It appears to be ok. Then I transfer it and view it's contents using Winrar. Winrar keeps telling me the file is corrupted. I have viewed other .gz or .bz2 files using winrar but for some odd reason I can't get it to work.

I would prefer just to have it zip the files so they have a .zip extension but even then when i try to browse it's contents both windows and winrar claim it's corrupt.

Does anyone else have a suggestion as to something else to try?


Solution:1

Well, most probably your files are perfectly fine before FTP transmission.

Unfortunately, probably you are transferring your files using wrong FTP mode.

FTP do have two modes: binary and ASCII. By default most clients use ASCII mode, which breaks your binary files completely. I don't know which FTP...

0 0
2

The tar command can be used with gzip to compress many files into a single archive while retaining file permissions and ownership. Please note that these files can be decompressed with WinZIP. Type tar czvf backup2.

Tgz HTML in your home directory to compress the contents of your HTML directory into backup2. Tgz Type tar xzvf backup2. Tgz in your home directory to restore (replace) the contents of your HTML directory from backup2.

More.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too...

0 0
3

The question is quite old and so are the answers.

Best answer since end of 2012 is: Use .NET 4.5 and the contained System.IO.Compression and System.IO.Compression.ZipArchive namespace classes.

One of many example links you receive if you search in the internet: http://www.codeproject.com/Articles/381661/Creating-Zip-Files-Easily-in-NET

Since 2014/2015 ff.: With Roslyn the whole framework library was published as Open Source, so AFAI understand it, you are free to extract the code from the 4.5 classes (as it should be not really system specific) and use it as a library for the earlier .NET frameworks. Maybe this would give some license advantages over using the other classes- but this has to be analyzed by...

0 0
4

It is very easy to compress a Whole Linux/UNIX directory. It is useful to backup files, email all files, or even to send software you have created to friends. Technically, it is called as a compressed archive. GNU tar command is best for this work. It can be use on remote Linux or UNIX server. It does two things for you:
=> Create the archive
=> Compress the archive

You need to use tar command as follows (syntax of tar command):
tar -zcvf archive-name.tar.gz directory-name
Where,

-z: Compress archive using gzip program -c: Create archive -v: Verbose i.e display progress while creating archive -f: Archive File name

For example, you have directory called /home/jerry/prog and you would like to compress this directory then you can type tar command as follows:
$ tar -zcvf prog-1-jan-2005.tar.gz /home/jerry/prog

Above command will create an archive file called prog-1-jan-2005.tar.gz in current directory. If you wish to restore your archive...

0 0
5

Image Result For How Do I Compress A Whole Linux Or Unix Directory

Explains how to use tar command to compress a whole directory recurse into directories under Linux or UNIX operating system..To tar and gzip a folder, the syntax is tar czf name_of_archive_file.tar.gz name_of_directory_to_tar. The is optional. If you want to tar the current directory, use . to designate that. To construct your filename, use the date utility look at its man page for the available format options . For example cd var .It is very easy to compress a Whole Linux UNIX directory. It is useful to backup files, email all files, or even to send software you have created to friends. Technically, it is called as a compressed archive. GNU tar command is best for this work. It can be use on remote Linux or UNIX server. It does two things .Compress an Entire Directory or a Single File. Use the following command to compress an entire directory or a single file on Linux. It ll also compress every other...

0 0
6

Comments are closed for this post.

Posted by Paul Smith @ 30 Aug 2006 5:10 AM

Nice looking task and usefull, but, I get System.OutOfMemoryException when trying to gzip a file of 936,000KB, any pointers would be gratefully accepted ;-)

Paul

Posted by Josh @ 05 Sep 2006 8:54 AM

Hi Paul,

Thanks for your feedback. I'm on vacation at the moment but I will have a look into this when I get back. Thanks again..

Josh

Posted by KC @ 29 Sep 2006 7:29 AM

Thank you very much for this task. It will be greatly used. The GZipStream Class you use is limited to files 4gb and smaller. Do you know if Microsoft has any plans for increasing this file size limitation in the near future? Is there a similar class available from Winzip?

Posted by Jeff @ 12 Oct 2006 8:50 PM

Any ideas on how to create (or if there is already something out there) a transformation that will compress individual columns?...

0 0