Home > System Tutorial > Linux > body text

Detailed explanation of tar compression and decompression commands under Linux system and its application in penetration courses

PHPz
Release: 2024-06-23 06:16:38
Original
717 people have browsed it

Linux 系统下 tar 压缩解压缩命令详解及在渗透课程中的应用

The penetration course has reached the access injection class. I feel that this is my dilemma. There is higher-level knowledge behind this class waiting for me to get in touch.

In this blog, I will first write about some sentence patterns under the Linux system that are often encountered when doing miscellaneous questions. Last time, the blog wrote seriously about web penetration.

tar compression and decompression command under Linux

tar

These five are independent commands for downloading the Red Hat Linux system. 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 files as needed.

The following parameter -f is required

-f: Do not use the file name. This parameter is the last parameter and can only be preceded by the file name.

#tar-cfall.tar*.jpg

This command is to package all .jpg files into a package named all.tar. -c means forming a new package, and -f specifies the file name of the package.

#tar-rfall.tar*.gif

This command is to reduce all .gif files to the all.tar package. -r means lowering the file.

#tar-ufall.tarlogo.gif

This command is to update the logo.gif file in the original tar package all.tar. -u means to update the file.

解压系统找不到指定的文件_linux系统解压deb_解压系统内核文件

#tar-tfall.tar

This command is to list all files in the all.tar package, -t means to list files

#tar-xfall.tar

This command is to extract all the files in the all.tar package, -t means to unpack

Compression

Unzip

Summary

1. Use tar-xvf to decompress *.tar

2. Use gzip-d or gunzip to decompress *.gz

3. Use tar-xzf to decompress *.tar.gz and *.tgz

4. Use bzip2-d or bunzip2 to decompress *.bz2

解压系统找不到指定的文件_linux系统解压deb_解压系统内核文件

5. Use tar-xjf to decompress *.tar.bz2

6. Use uncompress to decompress *.Z

7. Use tar-xZf to decompress *.tar.Z

8. Use unrare to decompress *.rar

9. Use unzip to decompress *.zip

Compression zip and decompression unzip command interpretation and examples under Linux

Interpretation and examples of compression and decompression commands under Linux

Example: The content of the current directory on the compression server is the xxx.zip file

zip-rxxx.zip./*

Extract the zip file to the current directory

unzipfilename.zip

解压系统找不到指定的文件_linux系统解压deb_解压系统内核文件

============================

Another: Some servers cannot execute the zip command without installing the zip packageLinux system decompression deb, but basically you can use the tar command. Examples are as follows:

tar-zcvf/home/zdzlibs.tar.gz/home/zdz/java/zdzlibs/

============================

linuxzip command

zip-rmyfile.zip./*

Compress all files and folders in the current directory into the myfile.zip file, -r means recursively compress all files in the subdirectory.

2.unzip

unzip-o-d/home/sunnymyfile.zip

Extract the myfile.zip file to /home/sunny/

-o: Overwrite files without prompting;

linux系统解压deb_解压系统找不到指定的文件_解压系统内核文件

-d:-d/home/sunny specifies to decompress the file to the /home/sunny directory;

3.Others

zip-dmyfile.zipsmart.txt

Delete the smart.txt file in the compressed file

zip-mmyfile.zip./rpm_info.txt

Add the rpm_info.txt file to myfile.zip in the compressed file

------------------------------------------------- ----------------------------------

To use zip to compress files, type the following command at the shell prompt:

zip-rfilename.zipfilesdir

In this counter example, filename.zip represents the file you created, and filesdir represents the directory where you want to place the new zip file. The -r option specifies that you want to recursively include all files contained in the filesdir directory.

To extract the contents of a zip file, type the following command:

解压系统内核文件_解压系统找不到指定的文件_linux系统解压deb

unzipfilename.zip

You can use the zip command to process multiple files and directories at the same time. The trick is to list them one by one Linux system decompression deb and separate them with spaces:

zip-rfilename.zipfile1file2file3/usr/work/school

The command inside compresses the contents of file1, file2, file3, and the /usr/work/school directory (assuming this directory exists) to Linux to view the hardware information, and then pours it into the filename.zip file.

The dpkg command is a utility tool used by DebianLinux systems to install, create and manage software packages

Note: When there is no network and dependencies are not taken into account, to install software locally, the dpkg command is commonly used

Thinking: What are the differences between dpkg and apt package managers? Answer: For ubantu, both commands are available. dpkg does not take into account the dependencies of software packages (it is better to use dpkg when there is no network. To install the software, the first step is to sort out the dependencies. The first step is to clarify the dependencies. (Download the software required in the second step in advance), apt manually installs the software package and its dependent software through the Internet.

Options

Parameters

Deb package: Specify the .deb package to operate.

Examples

Let’s make a blog for now;

Maythereaderbeinformed!

The above is the detailed content of Detailed explanation of tar compression and decompression commands under Linux system and its application in penetration courses. For more information, please follow other related articles on the PHP Chinese website!

source:itcool.net
Statement of this Website
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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!