Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use instructions in Linux

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use the instructions in Linux. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

1. Grammar

File [options] filename

2. List of options

Option

Description

-v |-- version

Display command version information

-- help

Show help documentation

-b |-- brief

When listing the results, the file name is not displayed

-C |-- compile

Write an magic.mgc output file that contains a pre-parsed version of the magic file or directory

-c |-- checking-printout

Printout to check the parsed form of the magic file. This is usually used with the-m flag to debug a new magic file before installing it.

-e |-- exclude testname

Excludes tests specified in testname from the list of tests that determine the file type. Valid test names are:

Apptype, EMX application type (on EMX only).

Text, various types of text files (this test will try to guess the text encoding, regardless of the setting of the Encoding option)

Encoding, different text encodings for soft magic tests

Tokens, looking for known tokens in a text file

Cdf, printing the details of the composite document file

Compress, check and view the compressed file

Elf, print the details of the ELF file.

Soft, check the magic files.

Tar, check the tar file

-F |-- separator

Specifies the delimiter between the file name and the result, default:

-f namefile |-- files-from namefile

From the given file, read the file name, and then operate the

-h |-- no-dereference

Option causes symbolic links not to be followed (on systems that support symbolic links). If the environment variable POSIXLY_TRIDER is not defined, this is the default

-I |-- mime

Causes the file command to output a string of type MIME instead of the more traditional human-readable string. Therefore, it can say 'text/plain;;charset=us-ascii'' instead of 'ASCII text'. To make this option work, the file changes the way it handles files identified by the command itself (for example, many text file types, directories, and so on), and uses another "magic" file. (see the file section below)

-- mime-type |-- mime-encoding

Similar to-I, but only prints the specified elements.

K |-- keep-going

Don't stop the first Standard PvP match, go on. The subsequent match will have the string '012muri'. (if a newline character is required, see the'- r 'option.)

-L |-- dereference

Option causes symbolic links to be followed, like the option of the same name in ls (1) (on systems that support symbolic links). If the environment variable POSIXLY_TRIDER is defined, this is the default

-m |-- www bxx5.com magic-file magicfiles

Specifies an alternate list of files and directories that contain magic. This can be a single item or a colon-separated list. If a compiled magic file is found next to a file or directory, it will be used.

-N |-- no-pad

Align the file name in the output

-n |-- no-buffer

After checking each file, force the stdout to be refreshed. This is useful only when checking the list of files. It is used for programs that want to output file types from pipes.

-p |-- preserve- (www 71swz.com) date

On systems that support utime (2) or utime (2), try to keep the access time for parsed files, pretending that the files have never been read.

-r |-- raw

Do not translate non-printable characters into\ ooo. Typically, files convert non-printable characters to their octal representation

-s |-- special-files

Typically, the file only attempts to read and determine the type of parameter file that the STAT (2) report is a normal file. This prevents problems because reading special files can have special consequences. Specifying the-s option causes file to also read parameter files, which are block files or character special files. This is useful for determining the file system type of data in the original disk partitions, which are block special files. This option also causes the file to ignore the file size reported by stat (2) because on some systems it reports that the size of the original disk partition is zero.

-z |-- uncompress

Try to view the compressed file

-0 |-- hhh263.comprint0

Outputs the empty character'\ 0' after the end of the file name. Production has been cut very well. This does not affect the delimiters that are still printed.

-z

Try to read the contents of the compressed file

This is the end of this article on "how to use instructions in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please 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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report