In Linux, tgz is a compressed file format; TGZ files are Gzip-compressed Tar files. Multiple files generated by TAR file archiving are compressed by Gzip and classified into one file, thereby reducing the space occupied. In Linux, you can use the tar command to decompress tgz files. The syntax is "tar zxvf file name.tgz -C /specify path" or "tar zxvf file name.tgz -C ./".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
tgz is a compressed file format.
TGZ files are Gzip-compressed Tar files. The files
.tar.gz
, or .tgz
are generally files compressed using tar and gzip under UNIX.
The .TAR file archive in the Unix system is compressed by Gnu Zip (.GZIP). Multiple files generated by the TAR file archive are compressed by Gzip and classified into one file, thereby reducing the space occupied.
Open the TGZ file. Different systems have slightly different opening methods. The required applications are as shown below:
Linux decompression.tgz , .tar.gz file
1. Linux operation .tgz file
1. Unzip the .tgz file:
(1) Extract to the current folder
Command: tar zxvf File name.tgz -C ./
eg:tar zxvf demo. tgz -C ./
(2) Extract to the specified folder
Command: tar zxvf file name.tgz -C /specified path
eg: Unzip to the home directory: tar zxvf simple-examples.tgz -C /Home
2. Operating the .tar.gz file under Linux
1. Compress .tar.gz file
Command: tar -zcvf Compressed file name.tar.gz Compressed file name
eg:tar -zcvf demo.tar.gz test
2. Decompression command:
Command: tar -zxvf Compressed file name.tar.gz -C /Specify path
eg:tar -zxvf demo.tar.gz -C /home
Supplement: tar detailed parameter introduction
-c: Create a compressed archive
-x: Decompress
-t: View the content
-r: Append to the end of the compressed archive file File
-u: Update the files in the original compressed package
These five are independent commands. One of them is used for compression and decompression. It can be used in conjunction with other commands but only one of them can be used. The following parameters are optional when compressing or decompressing archives as needed.
-z:
with gzip attribute -j:
with bz2 attribute -Z:
with compress attribute -v: Display all processes
-O: File Unpack to standard output
The following parameter -f is required
-f: Use the file name. Remember, this parameter is the last parameter, and can only be followed by the file name.
# tar -cf all.tar *.jpg
This command is to package all .jpg files into a package named all.tar. -c means generating a new package, and -f specifies the file name of the package.
# tar -rf all.tar *.gif
This command adds all .gif files to the all.tar package. -r means adding files.
# tar -uf all.tar logo.gif
This command is to update the logo.gif file in the original tar package all.tar. -u means to update the file.
# tar -tf all.tar
This command is to list all the files in the all.tar package, -t means to list the files
# tar -xf all. tar
This command is to extract all the files in the all.tar package. -t means to unpack
Compression
tar -cvf jpg.tar *.jpg //Package all jpg files in the directory into jpg.tar
tar -czf jpg.tar.gz *.jpg //Package all jpg files in the directory into jpg .tar, and compress it with gzip to generate a gzip-compressed package, named jpg.tar.gz
tar -cjf jpg.tar.bz2 *.jpg //All jpg in the directory After the file is packaged into jpg.tar, and compressed with bzip2, a bzip2-compressed package is generated and named jpg.tar.bz2
tar -cZf jpg.tar.Z *.jpg // After all the jpg files in the directory are packaged into jpg.tar, and compressed with compress, a umcompress-compressed package is generated, named jpg.tar.Z
rar a jpg.rar *.jpg // For compression in rar format, you need to download rar for linux first
zip jpg.zip *.jpg //For compression in zip format, you need to download zip for linux
and decompress it
tar -xvf file.tar //Extract tar package
tar -xzvf file.tar.gz //Extract tar.gz
tar -xjvf file.tar.bz2 //Extract tar.bz2
tar -xZvf file.tar.Z //Extract tar.Z
unrar e file.rar // Unzip rar
unzip file.zip //Unzip zip
Summary
1. *.tar Use tar -xvf Decompress
2, *.gz. Use gzip -d or gunzip to decompress
3, *.tar.gz and *.tgz. Use tar -xzf to decompress
4, * .bz2 Use bzip2 -d or bunzip2 to decompress
5, *.tar.bz2 use tar -xjf to decompress
6, *.Z use uncompress to decompress
7, *.tar.Z Use tar -xZf to decompress
8, *.rar Use unrar e to decompress
9, *.zip Use unzip to decompress
Related recommendations: "Linux video tutorial》
The above is the detailed content of What is the format of linux tgz. For more information, please follow other related articles on the PHP Chinese website!

MaintenanceModeinLinuxisaspecialbootenvironmentforcriticalsystemmaintenancetasks.Itallowsadministratorstoperformtaskslikeresettingpasswords,repairingfilesystems,andrecoveringfrombootfailuresinaminimalenvironment.ToenterMaintenanceMode,interrupttheboo

The core components of Linux include kernel, file system, shell, user and kernel space, device drivers, and performance optimization and best practices. 1) The kernel is the core of the system, managing hardware, memory and processes. 2) The file system organizes data and supports multiple types such as ext4, Btrfs and XFS. 3) Shell is the command center for users to interact with the system and supports scripting. 4) Separate user space from kernel space to ensure system stability. 5) The device driver connects the hardware to the operating system. 6) Performance optimization includes tuning system configuration and following best practices.

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

Linux maintenance mode can be entered through the GRUB menu. The specific steps are: 1) Select the kernel in the GRUB menu and press 'e' to edit, 2) Add 'single' or '1' at the end of the 'linux' line, 3) Press Ctrl X to start. Maintenance mode provides a secure environment for tasks such as system repair, password reset and system upgrade.

The steps to enter Linux recovery mode are: 1. Restart the system and press the specific key to enter the GRUB menu; 2. Select the option with (recoverymode); 3. Select the operation in the recovery mode menu, such as fsck or root. Recovery mode allows you to start the system in single-user mode, perform file system checks and repairs, edit configuration files, and other operations to help solve system problems.

The core components of Linux include the kernel, file system, shell and common tools. 1. The kernel manages hardware resources and provides basic services. 2. The file system organizes and stores data. 3. Shell is the interface for users to interact with the system. 4. Common tools help complete daily tasks.

The basic structure of Linux includes the kernel, file system, and shell. 1) Kernel management hardware resources and use uname-r to view the version. 2) The EXT4 file system supports large files and logs and is created using mkfs.ext4. 3) Shell provides command line interaction such as Bash, and lists files using ls-l.

The key steps in Linux system management and maintenance include: 1) Master the basic knowledge, such as file system structure and user management; 2) Carry out system monitoring and resource management, use top, htop and other tools; 3) Use system logs to troubleshoot, use journalctl and other tools; 4) Write automated scripts and task scheduling, use cron tools; 5) implement security management and protection, configure firewalls through iptables; 6) Carry out performance optimization and best practices, adjust kernel parameters and develop good habits.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software