To extract a specific file(s) from a tar.xz file, append a space-separated list of file names to be extracted after the archive name: tar -xf file1 file2 The following example shows how to extract the archive contents to the /home/linuxize/files directory: tar -xf -C /home/linuxize/files Extracting Specific Files from a tar.xz File # To extract archive files in a specific directory, use the -directory ( -C). tar -xvf īy default, tar extracts the archive contents in the current working directory This option tells tar to display the names of the files being extracted on the terminal. ![]() Windows users need a tool named 7zipįor more verbose output, use the -v option. To extract (unzip) a tar.xz file simply right-click the file you want to extract and select “Extract”. If the command-line is not your thing, you can use the GUI File manager. The same command can be used to extract tar archives compressed with other algorithms, such as. Tar auto-detects compression type and extracts the archive. To extract a tar.xz file, invoke the tar command with the -extract ( -x) option and specify the archive file name after the -f option: tar -xf The tar utility is pre-installed by default on all Linux distributions and macOS. This article explains how to use the tar command to extract (or unzip). ![]() By convention, the name of a tar archive compressed with xz ends with either. Xz is a popular algorithm for compressing files based on the LZMA algorithm. It supports a vast range of compression programs such as gzip, bzip2, lzip, lzma, lzop, xz and compress. Most people will find the first form more intuitive, but the second can be useful in more convoluted circumstances.ĭo double check the name to make sure that is a space and not an underscore ( TTRLinux_v1.2.0.tar.gz).The tar command allows you to create and extract tar archives. The second uses a character escape sequence (backslash + space) to indicate the space is part of a contiguous string. The first form quotes the argument, making it a single string. If the file really is called "TTRLinux v1.2.0.tar.gz", use: tar -xvzf "TTRLinux v1.2.0.tar.gz" There's no way for the interpreter to tell the difference here between two separate arguments, and one with a space in the middle. They're fine, but you have to take them into account. When you find it, the tar invocation you have should work.Īnother issue in play here are spaces in filenames. You can double check your location with pwd ("present working directory", same thing as CWD). It should list the file you want to extract. These are case sensitive, so be sure that's not Downloads. Then while in /home, I try tar -xvzf TTRLinux v1.2.0.tar.gz (yes, this is the name of the file) and I get four successive errors: tar (child): TTRLinux: Cannot open: No such file or directoryīut you said "I downloaded the file in /home/Pi/downloads" - why would you expect it to be in /home? cd /home/pi/downloads But if you try to cd /pi, you are asking for the absolute path /pi, which does not exist. If you cd pi, you would be trying to change to /home/pi, since pi is a relative path. If your CWD is /usr/local, that will refer to /usr/local/home/pi/whatever. Regardless of your current working directory (CWD), that refers to the same place. home/pi/whateverīegins with the root / and is thus an absolute path. ![]() The root is / there is a further standard for its organization on linux /home is part of that. Such a filesystem is structured like a tree. You evidently are confused by the nature of a hierarchical filesystem (a term appropriated by Apple for "HFS", but which long pre-dated them and applies to most contemporary filesystems). Changing directory to /pi fails because there is no such directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |