本文共 803 字,大约阅读时间需要 2 分钟。
file命令的语法格式为:
file(选项)(参数)
命令:
file Temp.txt
输出:
Temp.txt: UTF-8 Unicode text
命令:
file -b Temp.txt
输出:
UTF-8 Unicode text
命令:
file -i Temp.txt
输出:
Temp.txt: text/plain; charset=utf-8
命令:
file -f test
输出:
test: text/plain
命令:
file --F "--" test
输出:
--: text/plain
命令:
file -z test.gz
输出:
test.gz: gzip compressed data
命令:
file -L file
输出:
file: directory
通过file命令,您可以轻松探测出文件的类型,了解文件的性质。通过合理使用各种选项和参数,您可以获取更详细的信息,满足不同的需求。
转载地址:http://veut.baihongyu.com/