tar command basic examples

Intro

According to wikipedia, tar is a computer software utility for collecting many files into one archive file, often referred to as a tarball, for distribution or backup purposes.

Extract

user@host $ tar -tz -f archive.tar.gz
user@host $ tar -xzvf archive.tar.gz -C /a/folder
user@host $ tar -xzvf archive.tar.gz "./arch/file01" "./arch/file02"

Creation

root@host:~# apt-get install lzip
user@host $ tar --lzip -cvf archive.tar.lz /a/folder/*
user@host $ tar -cvf archive.tar /a/folder/*
user@host $ tar -czvf archive.tar.gz /a/folder/*
root@host~# tar cpjf backup.tgz /etc /var/log
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :