Replace FILENAME with whatever filename you want and DIRECTORY with the path to the directory you. 1 root root 1 Sep 28 12:46 9 -> 4Īs you can see there are many symlinks which exists in the test home directory. Put a Directory into a TAR file and Compress it with GZIP. Suppose I want to copy my home directory to some other location and my home directory consists of few symlinks # cd /home/test 3 - On the destination computer: cd /path/to/destination/folder tar xpvzf. 2 - Copy to the USB drive and then to the other computer. The gzip command compresses the file and creates a new compressed file with the. By default, tar will preserve file permissions and ownership when creating the archive. To compress a TAR directory using gzip, you can use the following command. I have to compress a directory using tar.gz preserving not only permissions, but ownership/groups too. So, as of now we need to use -h argument along with tar command but how and when? The Compress-Archive cmdlet creates a compressed, or zipped, archive file from one or more specified files or directories. 1 - On the source computer: cd /path/to/folder/to/copy tar cvpzf . There are different compression algorithms you can use, but the most common ones are gzip and bzip2. If you go through the man page of tar # man tarįollow symlinks archive and dump the files they point to If you do a normal compression/decompression, then you will loose all your symbolic links which is not a good idea for a production environment specially. Well there are times when you have to take backup of your Linux machine and copy it some other location but at the same time you don't want to loose all the symlinks which are their in your machine.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |