Specify the full path, tab completion can be used to auto-complete directory names. To extract to another location in the file system it is best practice to use an absolute path.Įxtract test_archive.tar to your desktop directory. Here we are in the Home directory, and most Linux distributions feature a Music directory which we can extract the archive to. So we can extract the archive to a sub directory inside a current directory, or we can specify the full path to another location in the file system.Įxtract test_archive.tar into the Music directory. The location can be a relative or absolute path. If we wish to extract an archive to a specific location we can use the C argument with the tar command and then specify the location. tar xf test_2Įxtract TAR Archives to a Specific Location Extract the bzip2 compressed tar archive. To extract a bzip2 compressed tar archive we need to add the z argument to identify that the archive uses the gzip compression method.ģ. Create a bzip2 archive by adding the j argument to the tar command. Archives typically end with either a tar.bz2 or tbz suffix.ġ. tar xzf test_Īnother alternative compression method for a tar archive is bzip2, which is invoked using the j argument. Then list the directory contents to show that test_directory has been created. Extract the gzip compressed tar archive using the z argument. To extract a gzip compressed tar archive we need to add the z argument to identify that the archive uses the gzip compression method.Ģ. Create a gzip archive by adding the z argument to the tar command. tar xf test_archive.tarĪ gzip compressed tar archive (tar.gz) is one of many popular compression tools for TAR archives and it is common to find a. After extracting the archive use ls to check the archive has been extracted. When we extract from our 3 archives we would be creating duplicates of the test_directory contents so we will delete this directory each time we extract the next archive.ġ. We again need to add arguments that respond to the type of compression tool the archive was created with. Instead of adding the c argument to create an archive we replace it with the x argument. Extracting TAR archives is straightforward.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |