![zip folder in linux zip folder in linux](https://linuxhint.com/wp-content/uploads/2018/05/z22.png)
#ZIP FOLDER IN LINUX ZIP FILE#
Lets preview the contents of this zip file without using the unzip command. rw-r-r- 1 root root 26M Nov 29 02:31 admin.zipĪs we see above, admin.zip file has been created whose size is 26M.
![zip folder in linux zip folder in linux](https://linuxconfig.org/wp-content/uploads/2020/10/03-zip-folder-in-linux.png)
![zip folder in linux zip folder in linux](https://i.ytimg.com/vi/s24e6yn-UYg/maxresdefault.jpg)
Lets try to zip the whole directory admin using -r switch. Ok In the directory admin, as we can see there are some files and directories.
#ZIP FOLDER IN LINUX HOW TO#
How to zip directory and its files in Linux ls admin/Īdmin controllers node_modules package-lock.json scriptsĬonfig doc LICENSE.md package.json README.md We got a message "zip diagnostic: credits.csv up to date" because of -v switch. zip -vu credits credits.csvĪs we see above, I used both the switches together in the above command -u and -v. v is to add more verbose information as shown below. it means zip didnt redo the operation since credits.csv not changed and we already had the credits.zip file present. time zip -u credits credits.csvĪs we see above, it just finished instantly. To see it we will have to time the operation.Lets try on our file and see what happens. Indeed the compression is marginally better 77% as compared to 76%. Lets try that and see what is the compress we get. There is another switch -9 which is used to compress better, so there should be relatively slower. If you run above, you will see it runs relative faster but compression is only 72% as compared to 76% compression we got earlier. Lets try the switch -1 according to the documentation it says compress faster but it compression is not as much, lets try that. We should not see any message if we use this switch. There you go, size of file is 44M which is 24% of original size. rw-rw-r- 1 root root 44M Nov 29 02:02 credits.zip Lets check the size of file now ls -lh credits.zip zip credits credits.csvĭeflated 76% means, file has been compressed by 76%. Lets compress it using zip and see what we get. rw-rw-r- 1 root root 182M Sep 21 10:29 credits.csvĪs we see above the size of file is 182M. Lets compress a file first and see how it works ls -lh credits.csv We will start with the basics of zipping files and directories and touch upon few of these switches which one should know. There are lot of options that come with zip. e encrypt -n don't compress these suffixes y store symbolic links as the link instead of the referenced file T test zipfile integrity -X eXclude eXtra file attributes A adjust self-extracting exe -J junk zipfile prefix (unzipsfx) F fix zipfile (-FF try harder) -D do not add directory entries x exclude the following names -i include only the following names read names from stdin -o make zipfile as old as latest entry c add one-line comments -z add zipfile comment q quiet operation -v verbose operation/print version info 0 store only -l convert LF to CR LF (-ll CR LF to LF) r recurse into directories -j junk (don 't record) directory names d delete entries in zipfile -m move into zipfile ( delete OS files) f freshen: only changed files -u update: only changed or new files
![zip folder in linux zip folder in linux](https://www.mchacks.net/p/files/xray-texture-resource-pack-1024x606.jpg)
If zipfile and list are omitted, zip compresses stdin to stdout. The default action is to add or replace zipfile entries from list, whichĬan include the special name - to compress standard input.
#ZIP FOLDER IN LINUX SOFTWARE#
Lets check what are the options available for zip command zip -helpĬopyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license. If it is not installed then, it will be installed. Package 86_64 already installed and latest version In Linux it is very easy to use zip utility. Zip is very useful utility to compress data to How to Zip Files and Directories in Linux