In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use file under Linux, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand.
Brief introduction
The official interpretation of file is:
File-determine file type
In other words, the meaning of the file type can be identified, and it can also be used to identify the encoding format of some files. It gets the file type by looking at the header information of the file, rather than determining the file type by extension, as Windows does, so it doesn't matter whether or not to add a suffix, who will fall in love with who, speaking of Windows, don't say anything.
Example
Let's take a look at some examples of comparative use.
Example 1: default
After file, follow the file directly to get the following information
➜file book.pdf delete.pdf: PDF document, version 1.3➜ file book delete: PDF document, version 1.3
You can see that it doesn't matter whether you add a suffix or not.
Example 2: do not display the name
➜file-b book.pdf PDF document, version 1.3
Plus-b parameter, is the meaning of brief, will only display the file identification results, not the file name, which is actually not very friendly for many files.
Example 3: output intelligible information
➜file-I delete.pdf delete.pdf: application/pdf; charset=binary
Adding the-I parameter is the meaning of the mime type, and I don't know what it means, but I can easily read the meaning of the file type I want to know. That's enough, isn't it? after all, we're here to use file commands.
Example 4: view the file information of the file name in the file
➜cat hello.txt sunset.jpg➜ file-f hello.txt sunset.jpg: JPEG image data, JFIF standard 1.01
This sounds so mouthful, actually very simple, actually not difficult, plus the-f parameter, is the meaning of the file-from type, in the end is how many meanings, that is, you want to view the file type information of the file name in a file, read the file from this file to the information, you can know as follows.
Example 5: beautiful chicken ribs
➜file-F "= =" sunset.jpg sunset.jpg = JPEG image data, JFIF standard 1.01
To tell you the truth, I don't understand what this function does. By default, it feels good, but of course this should be customized, as shown below:
Example 6: view file information of soft links
➜file a.jpg a.jpg: symbolic link to `sunset.jpg'➜ file-L a.jpg a.jpg: JPEG image data, JFIF standard 1.01
By default, if there is no L parameter, you can only get the information that the file is a soft link. If you add this parameter, you can see the file information of the source file, which is still a great feature.
Thank you for reading this article carefully. I hope the article "how to use file under Linux" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.