search
Homephp教程PHP开发Introduction to Linux decompression commands and usage of decompression commands

1. Introduction to decompression command
tar command
-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: Unzip the file 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 will delete all. jpg files are packaged 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 will delete all. The gif file is added 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.
# The command tar -tf all.tar is to list all the files in the all.tar package, -t means to list the files
# The command tar -xf all.tar is to extract all. For all files in the tar package, -x means unpacking
2. Use the compression command
tar –cvf jpg.tar *.jpg //Package all jpg files in the directory into tar.jpgtar –czf jpg. tar.gz *.jpgtar –cjf jpg.tar.bz2 *.jpg
// Pack all the jpg files in the directory into jpg.tar, and compress them with gzip to generate a gzip-compressed package, named For jpg.tar.gz

//Package all the jpg files in the directory into jpg.tar, and compress them with bzip2 to generate a bzip2 compressed package named jpg.tar.bz2tar – cZf jpg.tar.Z *.jpgrar a jpg.rar *.jpg
//Package all jpg files in the directory into jpg.tar, and compress them with compress to generate a umcompress compressed package, named For jpg.tar.Z

//rar format compression, you need to download rar for linuxzip jpg.zip *.jpg
//zip format compression, you need to download zip for linux first
3. Use the decompression command
tar –xvf file.tar //Extract tar package tar -xzvf file.tar.gz //Extract tar.gztar -xjvf file.tar.bz2 //Extract tar.bz2tar –xZvf file. tar.Z //Extract tar.Zunrar e file.rar //Extract rarunzip file.zip //Extract zip IV. Summary
1. Use tar –xvf to decompress *.tar
2. Use gzip for *.gz -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


For more articles about the introduction of Linux decompression commands and the use of decompression commands, please pay attention to the PHP Chinese website!


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

DVWA

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

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)