Sunday, January 15, 2017

How To Compress An Files On Windows or Linux

It's not really hard to archived your files into an compressed files like .zip, .rar, or .tar.gz you may also don't need an software to compress an .zip files, because if you're an windows user then you can actually compress it by just right clicking on the files and then click Send to > Compressed (zipped) folder and then it will compress the files, and even you also can open compressed (zipped files) without any software as compressed folder.

If you are Linux user then probably you should use the most used compression type called tar or tar.gz, you can compress your files by typing on console
tar -zcvf name-of-archive.tar.gz /path/to/directory-or-file
you can compress multiple files at once by typing
tar -zcvf archive.tar.gz /usr/local/gta /usr/public/minecraft /home/test/file1.txt /home/test/file2.txt
if you don't put parameters at the end of the extension of a files like .txt or .exe, that mean you the console will compress/archive the whole files in the folder

Compressing your files into zipped extension in Windows


The first thing that you have to do is go into a folder that contains the file which you want to compress, and then you can select these files by selecting using mouse or choose one by one by pressing CTRL+Click on the files, or just select all the whole files in the folder by pressing CTRL+A in the keyboard.

When you had finish selecting the files then right click into it and click Send to > Compressed (zipped) folder



It may take some time to compress these files, and there will appear window box to show you the current compressing progress.

Compressing your files using software

You can also compress your files using software for better and more advanced compression type, there some free software that you can download to compress you files like 7Zip.

Just like the picture above you can simply compress your files by right clicking into your selected files then click Add to archive... or if you want more advanced option you can open the program itself and make a configuration to compress your files.

Compressing your files into zipped extension in Linux


I think it's kinda hard that if you compress your files in Linux because you type much of lines if you want to compress a specific files, but if you a Linux user that has GUI then you may compress your files by download an software to compress your files just like in Windows, there some free software that can compress your files easily like PeaZip

But if you are still using console, then you can type tar -zcvf name-of-archive.tar.gz /path/to/directory-or-file

but if prefered using .zip extension files instead of tar.gz then you can type using syntax
zip {.zip-filename} {filename-to-compress}
So that's it, you can compress  your files thought your the software or the console.

Note for tar syntax:
-z: use gzip compress
-j: use bzip2 compress

No comments:

Post a Comment