Six file-related instances in Linux

Source: Internet
Author: User

Six file-related instances in Linux
GuideThe FILE command is used to identify the FILE type and identify the encoding format of some files. It obtains the file type by viewing the file header information, rather than determining the file type through the extension like Windows. This article describes six file-related instances in Linux.

Introduction

The official explanation of file is:

  1. File-determinefiletype

That is to say, it can identify the meaning of the file type, and can also be used to identify the encoding formats of some files. It obtains the file type by viewing the file header information, rather than determining the file type through the extension like in Windows, so it doesn't matter who will fall in love with the extension, speaking of Windows, let's not talk about it.

Instance

The following are some practical examples.

Instance 1: Default

File and then directly follow the file to obtain the following information:

  1. ➜Filebook.pdf
  2. Delete.pdf: Invalid document, version1.3
  3. ➜ Filebook
  4. Delete: Invalid document, version1.3

It can be seen that no suffix is added.

Instance 2: NO NAME IS DISPLAYED
  1. ➜File-bbook.pdf
  2. Invalid document, version1.3

The-B parameter indicates the meaning of brief. Only the file identification results are displayed, but the file name is not displayed. This is not very friendly for many files.

Example 3: Output easy-to-understand information
  1. ➜File-idelete.pdf
  2. Delete.pdf: application/pdf; charset = binary

The-I parameter is the meaning of the mime type. I don't know what it means, but I can easily understand the meaning of the file type I want to know. That's enough, isn't it? After all, we use the file command.

Example 4: view the file name information in the file
  1. ➜Cathello.txt
  2. Sunset.jpg
  3. ➜File-fhello.txt
  4. Sunset.jpg: Invalid imagedata, jsf-standard1.01

This is actually very simple. It is not difficult to add the-f parameter to the definition of the file-from type. What exactly does it mean, that is, if you want to view the file type information, the file name is located in a file. You can read the file information from this file as follows.

Example 5: Good-looking chicken ribs
  1. Export file-F "=" sunset.jpgsunset.jpg = export imagedata, JFIFstandard1.01

To tell the truth, I didn't understand what the function is. The default one is: It feels quite helpful. Of course, this should be customized, as shown below:

Instance 6: view the file information of the soft link
  1. Export filea.jpga.jpg: symboliclinkto'sunset.jpg'your file-la.jpga.jpg: Your imagedata, j1_standard1.01

By default, if there is no L parameter, you can only obtain the soft link information of the file. If you add this parameter, you can see the file information of the source file. This function is very good.

Address: http://www.linuxprobe.com/linux-six-file.html


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.