extract, add or list zip files in windows and linux

Simple tips for using zips files no matter of the OS and the tool. Archives are essential part of most computer tasks. Compression is very powerful tool that gives us way to store more information, transfer data faster and safer, provide back ups and many more. Next few tips may save you some time when you need to work with zip files.

List all files from a zip file

Linux

unzip

Install unzip if needed and use the command with argument l: unzip -l

sudo apt-get install unzip
unzip -l samplefile.zip

7z

7z is more advanced tool with bigger range of formats. It can be installed and used by:

sudo apt-get install p7zip-full
7z l zipfile.zip

Windows

For windows if you need to work with zip files via command prompt or with scripts you can use 7-zip (even with portable version). Steps to be used are:

Install 7-zip or use the portable version.

Open command prompt by:

Windows+R and then type cmd, press enter

or

Open start menu and type: Command Prompt , then press enter

Add 7-zip to environmental variable path (optional) in order to be able to execute commands only by typing 7z. Other wise you will need to write the full path the the command every time that you executed:

When you are adding it to path variable you will need to find the installation path of the application. Below there are several examples for permanent change, portable or installed version. You may consider also the version of the OS 32 or 64. When you are adding the variable you need only one path (below is just a sample with 3 different variants):