How to use the tar command, what is the tar command?

Updated on technology 2024-02-09
12 answers
  1. Anonymous users2024-02-06

    tar is not a script file, it is a Linux command.

  2. Anonymous users2024-02-05

    The command used should be a file-specific command.

    In the process command, the parameter is specified as a directory, so Linux gives an error saying "This is a directory". It can be understood that Linux is reminding that this is a directory and not a file, and this command should be for a file.

  3. Anonymous users2024-02-04

    The most commonly used archiving command in Linux is tar, which saves many files together to a separate tape or disk for archiving. Not only that, but the command can also restore the required files from the archive, which is the reverse process of packing, known as unpacking.

    Packages that are archived using the tar command are often referred to as tar packets.

    tar command.

    When the tar command is used for packing operations, the basic format of the command is:

    root@localhost ] tar [option] source file or directory.

    Options:

    c Package multiple files or directories.

    a Append the tar file to the archive file.

    fPackage Name Specifies the file name of the package. The extension of the package is used to identify the format for the administrator, so be sure to specify the extension correctly.

    v Displays the process of packing files.

    It is important to note that when using the tar command to specify an option, you can leave it without entering it in front of the option"-"For example, using"cvf"options and"-cvf"plays the same role.

    Example: Packaging files and directories

    root@localhost ~]# tar -cvf

    Package it as a file.

    Options:"-cvf"Closed auspicious is generally customary, remember that when packing, you need to specify the file name after packaging, and you need to use a friend".tar"as an extension. The same goes for packaging catalogs:

    root@localhost ~]# ll -d test/

    drwxr-xr-x 2 root root 4096 Jun 17 21:29 test

    test is our previous test directory.

    root@localhost ~]# tar -cvf test/

    test/test/test3

    test/test2

    test/test1

    Package the directory as a file.

    The tar command can also pack multiple files or directories as long as they are separated by spaces. For example:

    root@localhost ~]# tar -cvf /tmp/

    Package the files and tmp directory into a package.

  4. Anonymous users2024-02-03

    The original word tar command was originally designed to back up files to tape archive, hence the name tar

    The real thing looks like this.

    The tar command is a commonly used compress file and unzip file command in Linux systems.

    There are so many parameters in the tar command that we can only learn the parameters that satisfy the compress file and decompress file and shrink file commands.

    It should be used to install software, build applications, and deploy environments.

    For example, compress the adir directory and files in the root directory to:

    Note that it is a capital c

    If you don't use the -c parameter, you will be decompressed to the current working directory.

    Example: Extract the zip file to the root directory.

    c Create a new backup file.

    x Restore files from backup files.

    v Displays the command execution process.

    f Specify the backup file.

    z Process the backup file via the gzip command. (If the extracted file suffix is.) tar, no. gz, you don't need to use the -z parameter).

    c Specify the directory to be extracted to.

    Use xshell to connect to Linux

    Create a new tartest directory in the root directory.

    Go to the tartest directory.

    Compress the root lntest folder and root file into the root tartest directory, and the compressed file name is .:

    Go to the root tartest directory.

    Unplug the oak and press it to the current directory (root tartest).

    Unzip to the root rmtest directory.

  5. Anonymous users2024-02-02

    tar command: A tar file is a collection of several files and/or directories in one file. It's a great way to create backups and archives.

    The options used by the tar are:

    c — Create a new archive.

    f — When used with the -c option, the tar file created uses the file name specified by that option; When with"-x"option, the archive specified by that option is released.

    t - Displays a list of files to be included in the tar file.

    v — Displays the archiving progress of the file.

    x — Extracts files from the archive.

    z — Use gzip to compress the tar file.

    j — Use bzip2 to compress the tar file.

    To create a tar file, type:

    tar -cvf directory/file

    You can use the tar command to work with multiple files and directories at the same time by listing them one by one, spaced apart:

    tar -cvf /home/mine/work /home/mine/school

    The above command puts all the files in the work and school subdirectories of the home mine directory into a new file called in the current directory.

    To list the contents of a tar file, type:

    tar -tvf

    To extract the contents of the tar file, type:

    tar -xvf

    This command does not delete the tar file, but it will copy the unarchived contents to the current working directory, and retain any directory structure used by the archive. For example, if the tar file contains a file called , and the file is contained in the foo directory, then extracting the archive file will result in the creation of a foo directory in your current working directory that contains the file.

    By default, tar does not compress files. To create a compressed file that uses tar and bzip to archive compressed, use the -j option:

    tar -cjvf file

    The above command creates an archive and then compresses it into a file. If you use the bunzip2 command to extract the file, the file will be deleted, followed by the file.

    You can also use a command to extend and unarchive a bzip tar file:

    tar -xjvf

    To create a tar command and gzip command that is archived and compressed with tar and gzip.

    TAR can create archives for files and directories. With TAR, users can package (backup files) for a specific file, change files in an archive, or add new files to an archive.

    Originally used to pack on tape, TAR now allows users to pack on any device, such as floppy disks.

    With the tar command, you can package a large number of files and directories into a single file. Syntax: tar [primary + secondary] file or directory.

  6. Anonymous users2024-02-01

    tar should be a compression command in the Linux system, usually after compression, a *tar.

    Here's how to use it:

    Packing: tar -cvf file will package the file directory and all the files below it into a file.

    Decompression: tar -xvf will extract this compressed package to the file directory, I don't know if the explanation is clear enough? Can you help you?

  7. Anonymous users2024-01-31

    Brother, take a look here, there is a full set of tar command usage details.

  8. Anonymous users2024-01-30

    You can look at the man page of tar, which is very clear (look at the man page in English, the Chinese one is outdated, and many places are wrong).

    For the tar command, x means unpacking (not unzipping), v means showing the detailed process, f means using the file (it must be followed by a space plus the file name), and z means decompressing the gzip file first (this option is no longer required).

    Generally speaking, the options of Linux commands are not in order (xv and vx have the same effect), but when an option has an extra parameter, the argument must be followed by the corresponding option and nothing else in between (short options are separated by a space between the option arguments).

    tar -xzf means to unzip and unpack a file that should be packed by tar and compressed in gzip format.

    XFZ is obviously not the right combination of options, and it's better to add a "-" in front of the option to make it easier to read.

    Linux is updated quickly, try to read newer books, try to use newer software. After working hard to learn a Linux book from 10 years ago, I found that the world had completely changed, and it was so devastating. (Don't read books from three years ago, except for books that introduce C language and other contents, of course).

  9. Anonymous users2024-01-29

    Answer: These are all options for the tar command.

    z--- indicates that the gzip or gunzip command is invoked to compress or decompress the file;

    x --- indicates the unzipped package.

    f--- indicates the specified file.

    v--- indicates that the compression or decompression process is displayed.

    XFZ is several options used together, which mainly denotes the unzipping of the file but does not show the decompression process.

    Common usage of this command is:

    Packing: tar cvf filename. tar file unpacking: the name of the tar xvf file. tar

    Compressed package: tar zcvf file name. File unzip package: tar zxvf file name.

  10. Anonymous users2024-01-28

    z indicates that the decompressed package is GZ, and tar is a packager, not a compression program. *gz is a file compressed by the gzip command.

    tar is already integrated with gzip, so when unzipped*gz program, add x, and one is *bz, which is bzip, uses the -j parameter when decompressing.

    In addition, xfz seems to have been written incorrectly, and generally unzip a file if it is *gz ends with -xzvf, followed by f must be the filename.

  11. Anonymous users2024-01-27

    tar should be a compression command under the Linux system, usually compressed to generate a *tar.

    Here's how to use it:

    Packing: tar

    file will then package the file directory and all the files below it into a cheat file.

    Xie Xiaobu hypothesis: tar

    The package will be extracted to the file directory.

    I don't know if the explanation is clear enough? Can you help you?

  12. Anonymous users2024-01-26

    Brother, take a look here, take Zhao Zai Zhiwang, there is a full set of tar commands to use the detailed guess solution.

Related questions
8 answers2024-02-09

string excelname= excelfileurl();The path to return to excel. >>>More

4 answers2024-02-09

Dell provides **, data, or functions to programs running under the Windows operating system. The program can open, enable, query, disable, and close the driver according to the instructions in the DLL file. >>>More

8 answers2024-02-09

The most common symptoms of stomach disorders, the degree, nature, and duration of pain can vary depending on the condition. When the stomach contracts too much or eats too much, a feeling of tension or pressure pain may occur in the upper abdomen (heart socket); When the stomach is drooping or the stomach is distended, there may be a feeling of heaviness or distension due to the weakening or disappearance of contractions; Chronic gastritis often presents with discomfort, bloating, or pain in the upper abdomen after eating; In ulcer disease, stomach pain manifests as periodic hunger pains or nocturnal pains; The pain of ulcer perforation is manifested as a sudden, sharp knife-like pain. The main manifestations of dyspepsia are abdominal distention, belching, epigastric discomfort or dull pain. >>>More

6 answers2024-02-09

Fluctuation: I don't think the average person will add it, but those who are not ordinary will add it. Personally, I don't think it's added, ** technique: >>>More

4 answers2024-02-09

Some are applied to medicine and some are lasers, it is recommended to find a professional to take a look, moles can not be made casually.