


Display method: 1. Use Vim editor, syntax "vim compress file"; 2. Use "tar -tf compress file" command; 3. Use "rar v compress file" command; 4. Use " unrar l compress file" command; 5. Use "zip -sf compress file" command; 6. Use "unzip -l compress file" command; 7. Use "zipinfo compress file" command; 8. Use "zcat compress file" command. ; 9. Use "zless to compress files"; 10. Use less.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
10 ways to view the contents of compressed files under Linux
Generally speaking, when we view the contents of archived or compressed files, we need to decompress them first and then view them. ,kind of hard. Today I will introduce to you 10 different methods that allow you to easily view the contents of archived or compressed files without decompressing them.
Technically speaking, it is not possible to view archived or compressed files without decompressing them in advance. In the method introduced in this article, these compressed files will be decompressed in a temporary directory /tmp
in the background. After restarting the system, the contents of the /tmp
directory will be cleared.
Before discussing further, here is an explanation of archives and compressed files.
-
Archiving
is the process of combining multiple files or folders into one file. In this case, the resulting file is not compressed. -
Compression
is a result file obtained by combining multiple files or folders into one file and compressing them.
Archived files are not compressed files, but compressed files can be archived files. After understanding these two concepts, we formally introduce how to view the contents of compressed files without decompressing them.
1. Use the Vim editor
Vim
is not just an editor, it also contains many other powerful functions. The following command will directly display the contents of the compressed archive file:
$ vim test.tar.gz
Not only that, using Vim
you can even browse the archive file directly, if there is Text file, you can also open it directly, which is very convenient.
If you need to open a text file, just use the arrow keys to move the cursor in front of the file and press the ENTER
key. Can be opened
2. Use tar command
tar
command can not only be used to compress/decompress files, but also When extracting the tar
file, use the tar -tf
command to view the contents of the compressed package.
$ tar -tf test.tar
Alternatively, use the -v
option to view detailed properties of the archive file, such as permissions, file owner, group, creation date, etc.
$ tar -tvf test.tar
3. Use the rar command
Similarly, without extracting the rar
file You can use the rar v
command to view the contents of the compressed package.
$ rar v test.rar
4. Use the unrar command
For the above rar
file, you can also use The unrar
command with l
parameter views the contents of the rar
file.
$ unrar l test.rar
5. Use zip command
Can be used without extracting the zip
file zip -sf
command to view its contents.
$ zip -sf test.zip
6. Use the unzip command
is similar to unrar, use the -l
parameter unzip
command to view the contents of the zip
file.
$ unzip -l test.zip
7. Use the zipinfo command
to view the contents of the zip
file. You can also use zipinfo
command, execute the zipinfo command to get the detailed information of the zip compressed file.
$ zipinfo test.zip
zipinfo -v haicoder.zip
8.使用 zcat 命令
使用 zcat
命令查看归档/压缩文件。
$ zcat test.tar.gz
zcat
与 gunzip -c
命令功能相同。因此,你还可以用下面的命令:
$ gunzip -c test.tar.gz
9.使用 zless 命令
使用 zless
命令查看归档/压缩文件。
$ zless test.tar.gz
zless
类似于 less
,它可以逐页显示内容。
10.使用 less 命令
less
命令大家都可能有所了解了,它能以交互的方式查看文件内容。不仅如此,它还可以用来查看归档/压缩文件的内容:
$ less test.tar.gz
相关推荐:《Linux视频教程》
The above is the detailed content of How to display compressed file information in linux. For more information, please follow other related articles on the PHP Chinese website!

linux设备节点是应用程序和设备驱动程序沟通的一个桥梁;设备节点被创建在“/dev”,是连接内核与用户层的枢纽,相当于硬盘的inode一样的东西,记录了硬件设备的位置和信息。设备节点使用户可以与内核进行硬件的沟通,读写设备以及其他的操作。

区别:1、open是UNIX系统调用函数,而fopen是ANSIC标准中的C语言库函数;2、open的移植性没fopen好;3、fopen只能操纵普通正规文件,而open可以操作普通文件、网络套接字等;4、open无缓冲,fopen有缓冲。

端口映射又称端口转发,是指将外部主机的IP地址的端口映射到Intranet中的一台计算机,当用户访问外网IP的这个端口时,服务器自动将请求映射到对应局域网内部的机器上;可以通过使用动态或固定的公共网络IP路由ADSL宽带路由器来实现。

在linux中,eof是自定义终止符,是“END Of File”的缩写;因为是自定义的终止符,所以eof就不是固定的,可以随意的设置别名,linux中按“ctrl+d”就代表eof,eof一般会配合cat命令用于多行文本输出,指文件末尾。

在linux中,交叉编译是指在一个平台上生成另一个平台上的可执行代码,即编译源代码的平台和执行源代码编译后程序的平台是两个不同的平台。使用交叉编译的原因:1、目标系统没有能力在其上进行本地编译;2、有能力进行源代码编译的平台与目标平台不同。

在linux中,可以利用“rpm -qa pcre”命令判断pcre是否安装;rpm命令专门用于管理各项套件,使用该命令后,若结果中出现pcre的版本信息,则表示pcre已经安装,若没有出现版本信息,则表示没有安装pcre。

linux查询mac地址的方法:1、打开系统,在桌面中点击鼠标右键,选择“打开终端”;2、在终端中,执行“ifconfig”命令,查看输出结果,在输出信息第四行中紧跟“ether”单词后的字符串就是mac地址。

在linux中,rpc是远程过程调用的意思,是Reomote Procedure Call的缩写,特指一种隐藏了过程调用时实际通信细节的IPC方法;linux中通过RPC可以充分利用非共享内存的多处理器环境,提高系统资源的利用率。


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

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

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
