zip files

view zip files contents
unzip -l [file]
less [file]
view [file]


zip all files in a directory
zip *
zip directory recursive
zip -r [directory]


efficiently merge multiple zip files into a single zip file
zipmerge [destination] [source]...


create an encrypted zip wit password protection
7za a -tzip -p[password] -mem=AES256 [directory]


unzip complete zip file
dump specific zipped file to console
unzip -c '[file_in_zip]'
unzip complete zip to a directory
unzip -d destination_folder
skip existing files without prompt
unzip -n
overwrite existing files without prompt
unzip -o
unzip multiple zip files (use quotes)
unzip '*.zip'

tar.gz files

v: verbose => list all files
x: extract files (as opposed to collecting)
z: decompress using gzip (required for .gz files)
f: file => this must be the last flag of the command, and the tar file must be immediately after.

--remove-files => remove files from disk after adding them to the archive
list all files
tar -tzf [name].tar.gz
list all files verbose (access, size, timestamp)
tar -vtzf [name].tar.gz
Extracting an archive
tar -zxf [name].tar.gz
Extracting an archive verbose => prints all files while extracting
tar -vzxf [name].tar.gz
strip container folder (don't create unnecessary directory, extract to root)
tar -zxf [name].tar.gz --strip 1
extract to specified directory
tar -zxf [name].tar.gz -C [directory]
create tar file
tar -cvf output.tar [file]...
create tar.gz file
tar -czvf output.tar.gz [file]...