In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use the zip command in Linux. It is very detailed and has a certain reference value. Friends who are interested must finish it!
Linux common commands zip commands can be used to extract files, or to package files. Zip is a widely used compression program that compresses files to produce additional compressed files with the ".zip" extension.
Zip can be used to extract files
Syntax zip (options) (parameters) option-A: adjust executable automatically unzipped files;-b: specify the directory where the files are temporarily stored;-c: comment each compressed file;-d: delete the specified file from the compressed file;-D: no directory name is created in the compressed file -f: the effect of this parameter is similar to that of specifying the "- u" parameter, but not only updates existing files, but if some files do not originally exist in the compressed file, use this parameter to add them to the compressed file;-F: try to repair the corrupted compressed file;-g: add the compressed file to the existing compressed file instead of creating a new compressed file;-h: online help -I: compress only files that meet the criteria;-j: save only the file name and its contents without storing any directory names;-J: delete unnecessary data in front of the compressed file;-k: use the file name in MS-DOS-compatible format;-l: replace LF characters with LF+CR characters when compressing files;-ll: when compressing files, replace LF+cp characters with LF characters -L: display copyright information;-m: after the file is compressed and added to the compressed file, delete the original file, that is, move the file to the compressed file;-n: do not compress the file with a specific suffix string;-o: set the change time of the compressed file to the same as the file with the latest change time in the compressed file;-Q: do not display the instruction execution process -r: recursive processing, processing all files and subdirectories in the specified directory together;-S: including system and hidden files;-t: setting the date of the compressed file to the specified date;-T: checking whether each file in the backup file is correct;-u: replacing the newer file into the compressed file;-v: displaying instruction execution or version information -V: save the file attributes of the VMS operating system;-w: in the file name, if the version number, this parameter is only valid under the VMS operating system;-x: exclude eligible files during compression;-X: do not save additional file attributes;-y: save symbolic links directly, not the files that the link points to. This parameter is valid only in systems such as UNIX. -z: annotate the compressed file;-$: save the volume name of the disk where the first compressed file is located; -: the compression efficiency is a value between 1 to 9. Parameter zip package: specifies the zip package to be created
File list: specifies the list of files to compress.
The instance packages all files and folders in the / home/Blinux/html/ directory into the html.zip in the current directory:
The above command operation of zip-Q-r html.zip / home/Blinux/html is to compress the files and folders with absolute addresses. The following is the relative path directory for compression. For example, under the current Bliux directory, perform the following actions to achieve the same effect:
Zip-Q-r html.zip html, for example, in my html directory, the zip compression command I operate is:
Zip-Q-r html.zip * compress the contents of the example/basic/ directory into the basic.zip package-x specifies the exclusion directory, note that it will not work without double quotes.
Zip-r basic.zip example/basic/-x "example/basic/node_modules/*"-x "example/basic/build/*"-x "example/basic/coverage/*" is compressed and decompressed, and the content is stored in example/basic/,. If you want to store it in the root directory, enter the directory to compress it. Currently, you have not found a suitable parameter to solve this problem.
Cd example/basic/ & & zip-r basic.zip. -x "node_modules/*"-x "build/*"-x "coverage/*" compression efficiency selection:
Zip-9 # 1-9 faster- > better creates all files and folders under the public_html directory, excluding all files that include the text backup.
The $zip-r public_html.zip public_html-x * backup*httpdocs directory ignores the archiving of all files created under .svn files or git files and directories.
All files ignored by the $zip-r httpdocs.zip httpdocs-- exclude * .svn*-- exclude * .git*httpdocs directory, and an archive of all files is created under the directory ending with .log.
$zip-r httpdocs.zip httpdocs-- exclude "* .log" problem resolution command not found in CentOS7
-Bash: Unzip: Command Not Found solution
Yum install-y unzip zip above is all the contents of this article entitled "how to use zip commands in Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.