how to get list of files in zip linux 1

how to get list of files in zip linux

unzip -l file.zip

Here is what the above code is Doing:
1. We’re using the zipfile module to open the zip file.
2. We’re using the namelist() method to get a list of all the files in the zip file.
3. We’re using the getinfo() method to get information about each file in the zip file.
4. We’re using the infolist() method to get a list of all the files in the zip file.
5. We’re using the extractall() method to extract all the files in the zip file.
6. We’re using the extract() method to extract a single file from the zip file.
7. We’re using the printdir() method to print a directory of the zip file.
8. We’re using the printfile() method to print the contents of a file in the zip file.
9. We’re using the testzip() method to test the integrity of the zip file.
10. We’re using the unzip() method to unzip the zip file.

Similar Posts