![]() ![]() However, imagine when we’re checking the content of an archive containing thousands of files. rw-r-r- 0 1000 1000 3533473 Feb 2 10:40 tmp/test/document.pdfĪs the output above shows, since our test.zip has only eight files and directories, the whole file list fits on one screen. => use zip_file:contained_file to view a file in the archive Next, let’s launch the command less test.zip: $ less test.zip Actually, the less command can read Zip files and list the content in the archive too. We often pipe a verbose output to the less command to view the content in the Linux command line since we can navigate back and forth in the output. This is pretty helpful when we want to pass some filenames to other commands or scripts for further processing, as it minimizes the parsing effort. ![]() If this is the case, we can use the -1 option: $ zipinfo -1 test.zip What we need may only be the filenames in the Zip archive. Sometimes, we don’t want to see so much information. However, as we can see, the report contains detailed technical data of each file object in the archive. A subfield with ID 0x7875 (Unix UID/GID (any size)) and 11 data bytes:įor simplicity, we only extract the data of the last file tmp/test/document.pdf from the report. The local extra field has UTC/GMT modification/access times. A subfield with ID 0x5455 (universal time) and 5 data bytes. The central-directory extra field contains: Unix file attributes (100644 octal): -rw-r-r. Minimum software version required to extract: 2.0įile last modified on (DOS date/time): 2022 Feb 2 10:40:38įile last modified on (UT extra field modtime): 2022 Feb 2 10:40:38 localįile last modified on (UT extra field modtime): 2022 Feb 2 09:40:38 UTC Minimum file system compatibility required: MS-DOS, OS/2 or NT FAT Offset of local header from start of archive: 109575įile system or operating system of origin: Unix Now, let’s see what zipinfo can report about our test.zip: When we use the -v option, it can provide us with a detailed multi-page technical report about the Zip archive. Of course, the power of zipinfo isn’t limited to this. This is pretty friendly to Linux command-line users. However, it’s worth mentioning that the zipinfo command prints the list in the “ ls -l” layout, including the file permission attributes. Instead, it reports the compression rate of the entire archive at the end. We can see in the output above that, by default, zipinfo doesn’t show the compression rate of each file in the archive. ![]() bx defN 22-Jan-26 19:00 tmp/test/beautiful.png We can simply pass the Zip archive name to the command to get the file list: $ zipinfo test.zip The zipinfo command, as its name implies, lists detailed information about a Zip archive. The output above tells more information about the files – for example, the compression rates and the size after the compression, ![]() If we want to know more information about the files, we can use the -v option: $ unzip -v test.zip We should note that the “Length” values in the output are the file sizes before compression. Also, we can use the -l option to list the files in a Zip archive: $ unzip -l test.zipĪs we can see in the output above, unzip – l reports four properties of the files in the Zip archive: length, date, time, and filename, of course. The unzip command is a pretty convenient utility to decompress Zip archives. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |