rss logo

tar command with simples examples


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.


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"


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
root@host~# tar -jcvf - /my/fodler/ | ssh root@ "cat > /backup/$(date +%Y.%m.%d)_backup.tgz"
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :

contact mail address