Linux command detailed-file

Source: Internet
Author: User

file commands are used to identify file types and to identify the encoding format of some files. It does this by looking at the header information of the file to get the file type, rather than identifying the file type as Windows does by extension.

1 . Command format:

file [-BCHIKLNNPRSVZ] [-F NameFile] [-F separator] [-M magicfiles] file ...

2 . Command function:

used to view time information such as a calendar, such as a single parameter, indicates the year (1-9999) , if there are two parameters, the month and year

3 . Command parameters:

- b???????? When listing file identification results, the file name is not displayed.

- c???????? detailed instruction execution process to facilitate troubleshooting or analysis of program execution Scenarios

- F???????? list file types for file names in Files

- F???????? replaces the default ":" Delimiter after the output file name with the specified separator symbol.

- I.???????? Output MIME type of String

- L???????? view file types for corresponding soft link files

- z???????? try to interpret the contents of a compressed file

--help???? Show commands online Help

-version???? Display Command version information

4 . Usage Examples:

Example 1: Viewing file types

Command:

File Temp.txt

Output:

????

Example 2: Do not output file name, only show file format and encoding

Command:

File–b Temp.txt

Output:

?

Example 3: Output MIME-type string

Command:

File–i Temp.txt

Output:

?

Example 3: Viewing file types for file names in files

Command:

File-f Test

Output:

?

Example 4: Replace the default ":" Delimiter after the output file name with the specified separator symbol.

Command:

File–f "--" test

Output:

?

Example 5: Try to interpret the contents of a compressed file

Command:

File–z test.gz

Output:

?

Example 6: Viewing the file type of a soft link file

Command:

????????file -L sfile

Output:

?

?

?

Detailed Linux commands-file

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.