Compressed files use less disk space and download faster than large, uncompressed files. You can compress Linux files with the open-source compression tool Gzip or with Zip, which is recognized by most operating systems.
To compress multiple files into a .tar.gz file, let's look at the following example:
Let's say that we have a directory called "code", and within that directory there are a number of files and sub-directories. All you have to do is make sure that you are outside of the "code" directory, and then just type:
tar cfz myassignment.tar.gz code
You will now have a file called "myassignment.tar.gz" which contains your "code" directory and all of the files that were contained within that directory.
If you would like to use the ZIP file compression instead, you can just do the following:
zip -r myassignment.zip code
You will now have a file called "myassignment.zip".