rw-r-r- 1 root root 57K Apr 19 05:26 slashroot.txt rw-r-r- 1 root root 12K Apr 19 05:26 sarath.txt Let's have a look on the size of these files. So now if you want to zip a file in Linux, you must have some files to zip.Here i have created three files satish.txt, sarath.txt and slashroot.txt just for testing purpose.
How to zip a file using zip utility in Linux? Hence i would suggest to keep zip only to compress files with textual content. However if you compress some big video/audio files with zip or gzip, you will not get better results. Hence you can compress your large log file for example, and achieve a good compression ratio.
Zip,Gzip etc gives a wonderful compression ratio when used with simple text files. It can be used by different compression level and each level has it's own benefit and requirement which depends up on clients requirement.Īn important fact to note here about zip command is that, your compression ration always depends upon the type of files that you are compressing. Zip utility is to compress or you can say zip a file or files or a directory but what matters is it's compression ratio. We can see how zip utility is used and how it's beneficial to use as well as how to secure your zip files and what precautions you should take while zipping or while providing security to your zip files.To enhance security of zip files i have also included encryption and decryption concept a bit. If you have any question or suggestion, please feel free to comment bellow.Zip utility is used to combine as well as compress files in Linux.In this article i have included the uses of zip command and how to secure zip files.As i am going to discuss zip related security topics here so i have included security related loopholes too and also the trick or idea to remove such loopholes in detail with examples. This way unzip will help you to work with files.
To unzip the rar file to current directory unar backup.rarĬheck out all the options available for Unrar.
Ubuntu and Debian based OS distribution sudo apt-get install unar CentOS and Fedora based OS distribution sudo yum install unrar If you want to unzip the rar files, then first, you need to install unrar. Or if you want don't want to overwrite the file, then use -n option with file name Unzip the Rar file If you want to overwrite the file without asking, use -o option. If you do not want to unzip all the files and want to exclude some file, the use -x option with exclued files.
If your zip file is password protected, then use the -p option with password. This will display content of the zipped file. If you want to see the content in the zipped file without unzipping, the use -l option. Use the -d option if you want to unzip the files in the specifies directory. It will unzip all the files in the currenct folder without folders. The bellow command is the basic sintax to unzip the zipped file. Ubuntu and Debian based OS distribution sudo apt-get install unzip CentOS and Fedora based OS distribution sudo yum install unzip Unzip the Zipped fileįirst install the unzip from the bellow command. To zip the file, just use the bellow command. Or you can also install zip with just bellow command Ubuntu and Debian based OS distribution sudo apt-get install zip CentOS and Fedora based OS distribution sudo yum install zip You will get bellow response if zip is already installed. You can check it from the bellow command.
Zip comes preinstalled in the most Linux desktop environment. In this article, we will discuss on how to zip and unzip the files in Linux OS systems from the command line. Also it is fast to zip or unzip files from command-line. Also when we work in command-line server, there is no option we can zip file from the GUI. With Zip, we can also send the directory directly. Zip is the most common feature to compress the file and transfer the files easily.