tar

tar -zcvf data.tgz *.doc  - compress
tar -zxvf data.tgz  - decompress

tar -cf arhive.tar foo bar - create archive with files foo bar
tar -tvf file.tar - list file.tar

Now I want to extract a specific folder in the tarball (which inside the tarball lies in /tmp) into a specific folder:
cd /tmp
tar -xfvz archive.tar.gz folder/in/archive -C /tmp/archive


$tar --create --verbose --same-permissions --file /mnt/zip/tarball1 /home/etc/

ls /mnt/zip - here is created file tarball1

--create - create a tar file
--extract - extract a tar file
--verbose - get different errors
--same-permissions - maintenance the permissions of the directory where the files are copying
--file - creates file
----------------------

tar cvpf /home/iam/tarfile /home /etc
tar cvpf /home/iam/tarfile <--where data-blogger-escaped-be="" data-blogger-escaped-can="" data-blogger-escaped-do="" data-blogger-escaped-file="" data-blogger-escaped-store="" data-blogger-escaped-strong="" data-blogger-escaped-tar="" data-blogger-escaped-to="" data-blogger-escaped-want="" data-blogger-escaped-you="">/mnt/zip)
/home /etc <-- data-blogger-escaped-backup="" data-blogger-escaped-br="" data-blogger-escaped-do="" data-blogger-escaped-folders="" data-blogger-escaped-to="" data-blogger-escaped-want="" data-blogger-escaped-what="" data-blogger-escaped-you="">
--diff
d

--compare

tar /home/iam --newer 20May02 /etc this command will backup everything that have changed since 20May02


tar -tvf tarfilename --lists

tar -tvf tarfilename| more --lists PART list


tar -xvpf /home/iam/tartest /home/iam/222 -- restore deleted file

Comments

Popular posts from this blog

HAproxy logging

teamcity Automatic Agent Start under Linux

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all