Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the commands for Linux to extract files?

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what are the commands for Linux to extract files". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the commands for Linux to extract files"?

Extract the .zip file

The unzip command allows you to view and extract the zip file. The basic format of the command is as follows:

[root@localhost ~] # unzip [option] compressed package name

The common options and meanings of the unzip command are shown in the following table:

Option meaning-d directory name unzips the compressed file to the specified directory. -n unzipped does not overwrite existing files. -o overwrite existing files when unzipping, and no user confirmation is required. -v View the details of the compressed file, including the file size, file name, and compression ratio contained in the compressed file, but do not decompress it. -t tests the compressed file for corruption, but does not extract it. The-x file list decompresses the file, but does not contain the file specified in the file list. Extract the .gz file

Gunzip is a widely used extract command that is used to extract files compressed by gzip (.gz extension).

The basic format of the gunzip command is as follows:

[root@localhost ~] # gunzip [options] file

The common options and meanings of the gunzip command are shown in the following table:

Option meaning-r recursive processing, decompressing all files in the specified directory and subdirectories. -c output the decompressed file to the standard output device. -f force the file to be unzipped, regardless of whether the file already exists. -l lists the contents of the compressed file. -v shows the execution of the command. -t tests whether the compressed file is normal, but does not decompress it. Extract the .bz2 file

To extract the compressed package file in ".bz2" format, you can use the bunzip2 command in addition to the "bzip2-d compressed package name" command.

The use of the bunzip2 command is roughly the same as that of the gunzip command. The bunzip2 command can only be used to extract files. Even if you extract a directory, it also unzips all files in that directory and its subdirectories. The basic format is as follows:

[root@localhost ~] # bunzip2 [options] source file

The options and meaning of the bunzip2 command are shown in the following table:

Option meaning-after k is unzipped, the original compressed file is deleted by default. To keep the compressed file, use this parameter. When unzipping, if the output file has the same name as the existing file, the existing file will not be overwritten by default. To overwrite, use this option. -v shows the execution of the command. -L lists the contents of the compressed file. Thank you for your reading, these are the contents of "what are the commands for Linux to extract files?" after the study of this article, I believe you have a deeper understanding of what the commands for Linux decompression files have, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report