![]() Now we will extract the contents of documents.tgz file to separate /tmp/tgz/ directory. You may be requested an admin password and need to grant the Ubuntu package manager, called apt. First make sure that you create the specific directory that you want to extract into by using: mkdir -p /tmp/tgz. The *.tar.bz2 can be untarred like below. How to unzip file on Ubuntu Linux sudo apt-get install unzip. tgz) If your tar file is compressed using a gZip compressor, use this command: tar xvzf. The bz2 is another popular compression format where tar can be compressed with it. To uncompress the tar.gz file and put resulted files in a different directory, say /tmp/archive, you need to add a -C option at the end of the command. In the following example, we extract the tar.gz file. The tar files can be compressed with the gzip as gz format. PATH is optional and used in the tar file is extracted differently than the current working path.Ī tar file can be untared or extracted with the following command.OPTIONS is used to untar different compressions formats.The tar command has the following syntax which can be used to untar files and folders in different ways. ![]() In the tutorial, we examine how to untar files with different compressions algorithms like gz, bz2 etc. It tells tar the name and path of the compressed file. The same explanation applies: f: this must be the last flag of the command, and the tar f ile must be immediately after. The Linux tar stands for tape archive, which is used by a large number of Linux/Unix system administrators to deal with tape drive backup in Linux. The secret here is that you need to specify your filename just as it is in the tar. At some point tar was upgraded to auto-decompress. The most important function of the tar format is the ability to store multiple files and directories as a single file where it can be easily compressed. Now, to answer the question, if you want to un-tar one file named 'my-desired-file' from a tar archive named 'my-archive.tgz', and assuming the archive is compressed as most are these days, you'd use a command like this: tar xzvf my-archive.tgz my-desired-file. The tar format is used with different compression algorithms like gz, bz2, etc. The *.tar is a popular archive format used to compress files in Linux and Unix operating systems.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |