Linux zipinfo Command
The Linux zipinfo command is used to list detailed information about a compressed file.
Executing the zipinfo command provides detailed information about a zip compressed file.
Syntax
zipinfo [-12hlmMstTvz][compressed_file][files...][-x <pattern>]
Parameters:
-1 Lists only the file names.
-2 This parameter is similar to "-1", but can be used with "-h", "-t", and "-z".
-h Lists only the file names of the compressed file.
-l This parameter is similar to "-m", but lists the original file sizes instead of compression ratios.
-m This parameter is similar to "-s", but additionally lists the compression ratios for each file.
-M If the information content exceeds one screen, it is displayed in a manner similar to the more command.
-s Lists the contents of the compressed file in a format similar to executing "ls -l".
-t Lists only the number of files included in the compressed file, their sizes before and after compression, and the compression ratio.
-T Lists the date and time of each file in the compressed file in the format year, month, day, hour, minute, second.
-v Displays detailed information about each file in the compressed file.
-x <pattern> Does not list information for files that match the specified pattern.
-z Displays the comment if the compressed file contains one.
Example
Displaying compressed file information
[[email protected] a]# zipinfo cp.zip
Archive: cp.zip 486 bytes 4 files
-rw-r--r-- 2.3 unx 0 bx stor 24-May-10 18:54 a.c
-rw-r--r-- 2.3 unx 0 bx stor 24-May-10 18:54 b.c
-rw-r--r-- 2.3 unx 0 bx stor 24-May-10 18:54 c.c
-rw-r--r-- 2.3 unx 0 bx stor 24-May-10 18:54 e.c
4 files, 0 bytes uncompressed, 0 bytes compressed: 0.0%
[[email protected] a]#
Displaying detailed information about each file in the compressed file
``` [[email protected] a]# zipinfo -v cp.zip Archive: cp.zip 486 bytes 4 files
End-of-central-directory record:
Actual offset of end-of-central-dir record: 464 (000001D0h) Expected offset of end-of-central-dir record: 464 (000001D0h) (based on the length of the central directory and its expected offset)
This zipfile constitutes the sole disk of a single-part archive; its central directory contains 4 entries. The central directory is 248 (000000F8h) bytes long, and its (expected) offset in bytes from the beginning of the zipfile is 216 (000000D8h).
There is no zipfile comment.
Central directory entry #1:
a.c
offset of local header from start of archive: 0 (00000000h) bytes file system or operating system of origin: Unix version of encoding software: 2.3 minimum file system compatibility required: MS-DOS, OS/2 or NT FAT minimum software version required to extract: 1.0 compression method: none (stored) File security status: Not encrypted Extended local header: No File last modified on (DOS date/time): 2010 May 24 18:54:26 File last modified on (UT extra field modtime): 2010 May 24 18:54:26 local File last modified on (UT extra field modtime): 2010 May 24 10:54:26 UTC 32-bit CRC value (hex): 00000000 Compressed size: 0 bytes Uncompressed size: 0 bytes Length of filename: 3 characters Length of extra field: 13 bytes Length of file comment: 0 characters Disk number on which file begins: Disk 1 Apparent file type: Binary Unix file attributes (100644 octal): -rw-r--r-- MS-DOS file attributes (00 hex): None
The central-directory extra field contains:
- A subfield with ID 0x5455 (universal time) and 5 data bytes. The local extra field has UTC/GMT modification/access times.
- A subfield with ID 0x7855 (Unix UID/GID) and 0 data bytes.
There is no file comment.
Central directory entry #2:
b.c
Offset of local header from start of archive: 54 (00000036h) bytes File system or operating system of origin: Unix Version of encoding software: 2.3 Minimum file system compatibility required: MS-DOS, OS/2 or NT FAT Minimum software version required to extract: 1.0 Compression method: None (stored) File security status: Not encrypted Extended local header: No File last modified on (DOS date/time): 2010 May 24 18:54:26 File last modified on (UT extra field modtime): 2010 May 24 18:54:26 local File last modified on (UT extra field modtime): 2010 May 24 10:54:26 UTC 32-bit CRC value (hex): 00000000 Compressed size: 0 bytes Uncompressed size: 0 bytes Length of filename: 3 characters Length of extra field: 13 bytes Length of file comment: 0 characters Disk number on which file begins: disk 1 Apparent file type: binary Unix file attributes (100644 octal): -rw-r--r-- MS-DOS file attributes (00 hex): none
The central-directory extra field contains:
- A subfield with ID 0x5455 (universal time) and 5 data bytes. The local extra field has UTC/GMT modification/access times.
- A subfield with ID 0x7855 (Unix UID/GID) and 0 data bytes.
There is no file comment.
Central directory entry #3:
c.c
Offset of local header from start of archive: 108 (0000006Ch) bytes File system or operating system of origin: Unix Version of encoding software: 2.3 Minimum file system compatibility required: MS-DOS, OS/2 or NT FAT Minimum software version required to extract: 1.0 Compression method: none (stored) File security status: not encrypted Extended local header: no File last modified on (DOS date/time): 2010 May 24 18:54:26 File last modified on (UT extra field modtime): 2010 May 24 18:54:26 local File last modified on (UT extra field modtime): 2010 May 24 10:54:26 UTC 32-bit CRC value (hex): 00000000 Compressed size: 0 bytes Uncompressed size: 0 bytes Length of filename: 3 characters Length of extra field: 13 bytes Length of file comment: 0 characters Disk number on which file begins: disk 1 Apparent file type: binary Unix file attributes (100644 octal): -rw-r--r-- MS-DOS file attributes (00 hex): none
The central-directory extra field contains:
- A subfield with ID 0x5455 (universal time) and 5 data bytes. The local extra field has UTC/GMT modification/access times.
- A subfield with ID 0x7855 (Unix UID/GID) and 0 data bytes.
There is no file comment.
Central directory entry #4:
e.c
Offset of local header from start of archive: 162 (000000A2h) bytes file system or operating system of origin: Unix version of encoding software: 2.3 minimum file system compatibility required: MS-DOS, OS/2 or NT FAT minimum software version required to extract: 1.0 compression method: none (stored) file security status: not encrypted extended local header: no file last modified on (DOS date/time): 2010 May 24 18:54:26 file last modified on (UT extra field modtime): 2010 May 24 18:54:26 local file last modified on (UT extra field modtime): 2010 May 24 10:54:26 UTC 32-bit CRC value (hex): 00000000 compressed size: 0 bytes uncompressed size: 0 bytes length of filename: 3 characters length of extra field: 13 bytes length of file comment: 0 characters disk number on which file begins: disk 1 apparent file type: binary Unix file attributes (100644 octal): -rw-r--r-- MS-DOS file attributes (00 hex): none
The central-directory extra field contains:
- A subfield with ID 0x5455 (universal time) and 5 data bytes. The local extra field has UTC/GMT modification/access times.
- A subfield with ID 0x7855 (Unix UID/GID) and 0 data bytes.
There is no file comment.