triadatrust.blogg.se

Untar .tar
Untar .tar







  1. #UNTAR .TAR ARCHIVE#
  2. #UNTAR .TAR DOWNLOAD#

Always make sure that the directory into which you want to extract tar file exists. In the first example, I will extract the files in articles.tar to a directory /tmp/my_article. Example 1: Extracting tar Files to a Specific Directory tar -xvzf ukulele_ us now look at some examples below. The files and directories that would have been extracted to that directory are extracted in the target directory.

untar .tar

If we specify -strip-components=1 with our example tar file, the Ukulele Songs top-most directory within the tar file is not created on the hard drive. Files from the ignored directories are still extracted, but the directory structure is not replicated on your hard drive. The number represents how many levels of directories to ignore. The -strip-components option requires a numerical parameter. If you don’t want the directory structure in the tar file to be recreated on your hard drive, use the -strip-components option. tar -xvz -wildcards -f ukulele_ "Ukulele Songs/Possibles/B*"Įxtracting Files Without Extracting Directories Using wildcards requires the use of the -wildcards option. You can extract a selection of files by using wildcards, where * represents any string of characters and ? represents any single character. tar -xvzf ukulele_ "Ukulele Songs/023 - My Babe.odt" To extract a single file, provide the path and the name of the file. If we want to extract the files to a location other than the current directory, we can specify a target directory using the -C (specified directory) option.

untar .tar

#UNTAR .TAR DOWNLOAD#

If we list the files in the Download directory we will see that another directory called Guitar Songs has been created.

  • -f: File, name of the tar file we want tar to work with.
  • -j: Bzip2, use bzip2 to decompress the tar file.
  • untar .tar

  • -x: Extract, retrieve the files from of the tar file.
  • To be clear, the command line options we used with tar for the. Once again, the files are listed to the terminal as they are extracted. Instead of using the -z (gzip) option, we will use the -j (bzip2) option. bz2 extension suffix tells us it has been compressed using the bzip2 command. To do this we’ll use almost exactly the same command as before but with one important difference. Where did this directory come from? It was contained in the tar file, and was extracted along with the files. The extracted files are in that directory. List the files in the directory with ls and you’ll see that a directory has been created called Ukulele Songs. This option must be followed by the name of the tar file.
  • -f: File, the name of the tar file we want tar to work with.
  • -z: Gzip, use gzip to decompress the tar file.
  • untar .tar

    -v: Verbose, list the files as they are being extracted.-x: Extract, retrieve the files from the tar file.Let’s extract the ukulele songs: tar -xvzf ukulele_Īs the files are extracted, they are listed in the terminal window. These files are in the Downloads directory. One file is called ukulele_, the other is called guitar_2. Let’s say you’ve downloaded two files of sheet music. You just need to use the appropriate tar command line options.

    #UNTAR .TAR ARCHIVE#

    bz2 extension suffix indicates that the archive has been compressed, using either the gzip or bzip2 compression algorithm. The tar command will work happily with both types of file, so it doesn’t matter which compression method was used-and it should be available everywhere you have a Bash shell.









    Untar .tar