Linux Archives
TAR
Create gz
Create bz2 Extract Extract multipart archive Multipart archive from ISP-manager# Combines all parts to one file
for i in `ls -1v FYYYY-MM-DD.USER.tgz.part*`;do cat $i >> archive.tgz;done
# Extract
tar -xzf archive.tgz -C /destination/path
7ZIP
Setup
Create Don't show progressZIP
# -q: quiet mode
# Task: archive the directory structure without files
# Create an empty marker file in every subdirectory
find /path/to/dir -type d -exec touch "{}"/.arch \;
# Add only this marker, along with the directory structure, to the archive!
zip -r test.zip /path/to/dir -i "*.arch"
# Archive files listed in a file
zip /path/to/arch.zip -@ < /tmp/file_with_list_to_arch
# Find files and add them directly to the archive
find /var/www -type f -name index.html -print | zip /tmp/indexhtml.zip -@
Exclude items from the archive / include ONLY THESE items in the archive
# Do not include some subdirectories in the archive
zip -r test.zip /path/to/dir -x@/path/to/exclude.lst
# cat /path/to/exclude.lst
/path/to/dir/logs/*
/path/to/dir/cache/*
#
# Conversely: include ONLY THESE items in the archive
zip -r test.zip /path/to/dir -i@/path/to/exclude.lst
UNZIP
Show files and their size in the archive