In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the "Linux basic command zipinfo usage" of the relevant knowledge, in the actual case of the operation process, many people will encounter such a dilemma, then let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
zipinfo
Get the details of the zip file without decompression. zipinfo lists technical information about files in ZIP archives, most commonly on MS-DOS systems. This information includes file access rights, encryption status, compression type, version, and operating system or compressor file system. The default behavior (no options) is to list a single-line entry for each file in the archive, with the header and trailer lines providing summary information for the entire archive. The format is an intersection between Unix'ls-l' and 'unzip-v' outputs. See details below. Note that zipinfo is the same as the decompressor (under Unix, link to it); however, on some systems, zipinfo support may be ignored during decompressor compilation.
This command applies to Red Hat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.
1. Grammar
zipinfo [-12smlvhMtTz] file[.zip] [file(s) ...] [-x xfile(s) ...]
2. Parameters and options list
option
description
file[.zip]
Path to ZIP archive. If the file specification is a wildcard, each matching file is processed in the order determined by the operating system (or file system). Only file names can be wildcards; paths themselves cannot. Wildcard expressions are similar to unix egrep(1)(regular) expressions and may contain
[file(s)]
Optional list of archive members to process, separated by spaces. (VMS versions defined with VMSCLI must be comma-separated files.) Regular expressions (wildcards) can be used to match multiple members; see above. Also, be sure to reference expressions that would otherwise be expanded or modified by the operating system.
[-x xfile(s)]
Optional list of archive members to exclude from processing.
option
description
-h | --help
help information
-V | --version
Display command version information
-1
List only file names
-2
Similar to "-1" but can be used alone with other options "-h", -i", -z"
-s
Short format like "ls -l"
-m
Medium format similar to "ls -l"
-l
Long format like "ls -l"
-v
Show zip file details
-h
List only compressed package file name, size, number of files in package
-M
Similar to more command, split screen display
-t
List the number of files in the compressed file, file size before and after compression, compression ratio
-T
List the dates of files in the compressed package in the order of year, month, day, hour, minute and second
-z
Show comment information for compressed files
3. Example code
To get a basic, short list of the complete contents of ZIP archive Storage.zip with header and total lines, use only the archive name as a parameter to zipinfo.
zipinfo storage
To generate a basic, long-format list (not a lengthy one), including headings and totals, use-l:
zipinfo -l storage
To list the complete contents of an archive without title and total rows, you can omit the-h and-t options, or specify the contents explicitly:
zipinfo --h-t storage
zipinfo storage \*
By default, to turn off summary rows, use the environment variable (assumed to be a C shell here):
setenv ZIPINFO --t
zipinfo storage
To get a complete, short list of the first example again, it is necessary to explicitly specify the-s option, given that the environment variable was set in the previous example, because the-t option itself means that only footer lines are printed
setenv ZIPINFO --t
zipinfo -t storage [only totals line]
zipinfo -st storage [full listing]
To list information about individual files in the archive in medium format, explicitly specify the file name.
zipinfo -m storage unshrink.c
The specification of any member file overrides the default header and totals; only one line of information about the requested file is printed. This is the intuitive result expected when requesting information about a single file. For multiple files, it is often useful to know the total compressed and uncompressed sizes; in this case, you can explicitly specify-t:
zipinfo -mt storage "*. [ch]" Mak\*
To get the most information about ZIP archives, use the Details option. If the operating system allows it, it is usually wise to route the output to a filter such as Unix More(1):
zipinfo -v storage | more
To view the most recently modified files in the archive, use the-T option in conjunction with external sorting utilities such as Unix Sort(1) and sed(1
zipinfo -T storage | sort -nr -k 7 | sed 15q
4. Examples
1) Display information in compressed files
[root@localhost weijie]# zipinfo res.zip file information in compressed package
Archive: res.zip
Zip file size: 907 bytes, number of entries: 5
-rw-r--r-- 3.0 unx 0 BX stor 18-Sep-14 10:46 11.c
-rwxr--r-- 3.0 unx 15 TX stor 18-Sep-19 16:08 4.c
-rwxr--r-- 3.0 unx 11 TX defN 18-Sep-19 16:08 2.c
-rwxr--r-- 3.0 unx 15 TX stor 18-Sep-19 16:08 3.c
-rw-r--r-- 3.0 unx 38 TX defN 18-Sep-14 09:41 5.c
5 files, 79 bytes uncompressed, 73 bytes compressed: 7.6%
2) Use the-h option
[root@localhost weijie]# zipinfo -h res.zip only package size, file count
Archive: res.zip
Zip file size: 907 bytes, number of entries: 5
"Linux basic command zipinfo usage" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
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: 254
*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.