In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to view the contents of compressed files under Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
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 ENTERtest/imag.jpgtest/file.pdftest/song.mp3test/
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.tartest/test/image.jpgtest/file.pdftest/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.tardrwxr-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.mp33. 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.rarRAR 5.60 Copyright (c) 1993-2019 Alexander Roshal 24 Jun 2019Trial version Type 'rar -?' For helpArchive: test.rarDetails: RAR 5Attributes Size Packed Ratio Date Time Checksum Name--rw-r--r-- 53632 52166 97% 2019-06-29 15:57 70260AC4 test/image.jpg-rw-r--r-- 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--9912682 9849787 99% 34. 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.rarUNRAR 5.60 freeware Copyright (c) 1993-2019 Alexander RoshalArchive: test.rarDetails: RAR 5Attributes 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 35. 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.zipArchive contains:Life advices.jpgTotal 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.zipArchive: test.zipLength Date Time Name- 597219 2019-04-09 12:48 Life advices.jpg--597219 1 file7. Use the zipinfo command
To view the contents of the zip file, you can also use the zipinfo command.
$zipinfo test.zipArchive: test.zipZip file size: 584859 bytes, number of entries: 1 Murray RWMurMurr Murray-6.3 unx 597219 bx defN 18-Apr-09 12:48 Life advices.jpg1 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.gz9. 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:
I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.