1. Zip
Following are the main compression utilities that are available 🙂
Format for zipping the files:Â zip <filename> <source_files>
—————————–OUTPUT——————————————————-
[root@kalwa2 zip_test]# zip test.zip test1.txt test2.txt test3.txt
adding: test1.txt (deflated 92%)
adding: test2.txt (deflated 92%)
adding: test3.txt (deflated 92%)
[root@kalwa2 zip_test]# ll
total 16
-rw-r–r–. 1 root root 221 Jun 14 09:02 test1.txt
-rw-r–r–. 1 root root 221 Jun 14 09:02 test2.txt
-rw-r–r–. 1 root root 221 Jun 14 09:03 test3.txt
-rw-r–r–. 1 root root 511 Jun 14 09:10 test.zip
[root@kalwa2 zip_test]#
—————————–END OF OUTPUT———————————————
Format for UNzipping the files:Â unzip <filename>.zip
—————————–OUTPUT——————————————————-
[root@kalwa2 zip_test]# ll
total 16
-rw-r–r–. 1 root root 221 Jun 14 09:02 test1.txt
-rw-r–r–. 1 root root 221 Jun 14 09:02 test2.txt
-rw-r–r–. 1 root root 221 Jun 14 09:03 test3.txt
-rw-r–r–. 1 root root 511 Jun 14 09:10 test.zip
[root@kalwa2 zip_test]# rm -f *.txtÂ
Note: Removing txt files for better understanding of the topic please do not perform this command in your environment.
[root@kalwa2 zip_test]# ll
total 4
-rw-r–r–. 1 root root 511 Jun 14 09:10 test.zip
[root@kalwa2 zip_test]# unzip test.zip
Archive: test.zip
inflating: test1.txt
inflating: test2.txt
inflating: test3.txt
[root@kalwa2 zip_test]# ll
total 16
-rw-r–r–. 1 root root 221 Jun 14 09:02 test1.txt
-rw-r–r–. 1 root root 221 Jun 14 09:02 test2.txt
-rw-r–r–. 1 root root 221 Jun 14 09:03 test3.txt
-rw-r–r–. 1 root root 511 Jun 14 09:10 test.zip
[root@kalwa2 zip_test]#
—————————–END OF OUTPUT———————————————
                                     Â
Leave a Reply