In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces you how to view the compressed file content in Linux, the content is very detailed, interested friends can refer to, hope to be helpful to you.
1. Use the Vim Editor
Vim is not just an editor, it also contains many other powerful features. The following command directly displays the contents of the compressed archive file:
$vim test.tar.gz "tar.vim version v29" Browsing tarfile / home/alvin/test.tar.gz "Select a file with cursor and press ENTER test/imag.jpg test/file.pdf test/song.mp3 test/
Not only that, you can even browse the archive file directly with Vim, and if there is a text file in it, you can open it directly, which is very convenient.
If you need to open a text file, simply use the arrow keys to move the cursor to the front of the file, and then press ENTER to open it.
two。 Use the tar command
The tar command can not only be used to compress / extract files, but you can also use the tar-tf command to view the contents of the package without extracting the tar file.
$tar-tf test.tar test/ test/image.jpg test/file.pdf test/song.mp3
"alternatively, use the-v option to view the detailed properties of the archive file, such as permissions, file owner, group, creation date, and so on."
$tar-tvf test.tar drwxr-xr-x alvin/users 0 2019-07-02 19:30 test/-rw-r--r-- alvin/users 53632 2019-06-29 15:57 test/image.jpg-rw-r--r-- alvin/users 156831 2019-06-04 12:37 test/file.pdf-rw-r--r-- alvin/users 9702219 2019-04-25 20:35 test/song.mp3
3. Use the rar command
Similarly, you can use the rar v command to view the contents of the package without extracting the rar file.
$rar v test.rar RAR 5.60 Copyright (c) 1993-2019 Alexander Roshal 24 Jun 2019 Trial version Type 'rar -?' For help Archive: test.rar Details: RAR 5 Attributes Size Packed Ratio Date Time Checksum Name-rw-r--r-- 53632 52166 97% 2019-06-29 15:57 70260AC4 test/image.jpg-rw-r-- DD875AC4 test/song.mp3-156831 139094 88% 2019-06-04 12:37 C66C545E test/file.pdf-rw-r--r-- 9702219 9658527 99% 2019-04-25 20:35 DD875AC4 test/song.mp3
4. Use the unrar command
For the above rar file, you can also use the unrar command with the l parameter to view the contents of the rar file.
$unrar l test.rar UNRAR 5.60 freeware Copyright (c) 1993-2019 Alexander Roshal Archive: test.rar Details: RAR 5 Attributes Size Date Time Name-rw-r--r-- 53632 2019-06-29 15:57 test/image.jpg-rw-r--r-- 156831 2019-06-04 12:37 test / file.pdf-rw-r--r-- 9702219 2019-04-25 20:35 test/song.mp3-9912682 3
5. Use the zip command
You can use the zip-sf command to view the contents of the zip file without extracting it.
Zip-sf test.zip Archive contains: Life advices.jpg Total 1 entries (597219 bytes)
6. Use the unzip command
Much like unrar, use the unzip command with the-l argument to view the contents of the zip file.
Unzip-l test.zip Archive: test.zip Length Date Time Name-597219 2019-04-09 12:48 Life advices.jpg-- 597219 1 file
7. Use the zipinfo command
To view the contents of the zip file, you can also use the zipinfo command.
$zipinfo test.zip Archive: test.zip Zip file size: 584859 bytes, number of entries: 1-rw-r--r-- 6.3 unx 597219 bx defN 18-Apr-09 12:48 Life advices.jpg 1 file, 597219 bytes uncompressed, 584693 bytes compressed: 2.1%
8. Use the zcat command
Use the zcat command to view archived / compressed files.
$zcat test.tar.gz
Zcat has the same function as the gunzip-c command. Therefore, you can also use the following command:
$gunzip-c test.tar.gz
9. Use the zless command
Use the zless command to view archived / compressed files.
$zless test.tar.gz
Zless is similar to less in that it can display content page by page.
10. Use the less command
The less command, which you may all know, can view the contents of a file interactively. Not only that, it can also be used to view the contents of archived / compressed files:
Less test.tar.gz on how to view compressed files in Linux to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.