![]() You can confirm its contents: $ tar ztvf ĭrwxrwxr-x saml/saml 0 08:04 dir1/dir11/ Which results in the following single file: $ ls -l | grep tar If you'd prefer to zip up the directory structure then you'll likely want to use the tar command, and then compress the resulting. Rather it will walk that directory structure and zip each file that it finds into a separate file. The gzip command will not recursively compress a directory into a single zip file, when using the -r switch. Tar has many, many, MANY other options and uses as well I heartily recommend reading through its manpage sometime. That command is effectively the same as gunzip < | tar -xv ![]() For archiving and compressing tar files we need to execute the following command. To decompress and unpack the archive into the current directory you would use tar -zxvf Tar command produces a compressed file using gzip and bzip2 which can be accessed by providing the -z and -j options to the command respectively. The command above is effectively the same as tar -cv directory | gzip > The gzip command/lib is completely separate. The tar command offers gzip support (via the -z flag) purely for your convenience. ![]() V (verbosely) list (on /dev/stderr so it doesn't affect piped commands) all the files it adds to the archive.Īnd store the output as a f (file) named In order to "zip" a directory, the correct command would be tar -zcvf directory/Ĭ (create) an archive from the files in directory ( tar is recursive by default) Unlike zip, gzip functions as a compression algorithm only.īecause of various reasons some of which hearken back to the era of tape drives, Unix uses a program named tar to archive data, which can then be compressed with a compression program like gzip, bzip2, 7zip, etc. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |