hopeless-dream

导航

file命令

file命令用于查看文件类型

[root@localhost test]# ll
total 12
lrwxrwxrwx 1 root root    4 Aug 24 17:28 s1_test -> test
lrwxrwxrwx 1 root root    4 Aug 24 17:19 s_test -> test
-rw------- 1 root root 1672 Aug 24 17:19 s_test1
-rw------- 1 root root 1672 Aug 24 16:33 test
-rw-r--r-- 1 root root   12 Aug 27 22:51 test.sh

文本文件

[root@localhost test]# file test
test: ASCII text

软链接文件

[root@localhost test]# file s_test
s_test: symbolic link to `test'

脚本文件

[root@localhost test]# file test.sh
test.sh: Bourne-Again shell script, ASCII text executable

二进制可执行程序

[root@localhost test]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=c5ad78cfc1de12b9bb6829207cececb990b3e987, stripped

目录

[root@localhost test]# mkdir a
[root@localhost test]# file a
a: directory

设备文件

[root@localhost test]# file /dev/sdb1
/dev/sdb1: block special

 

posted on 2021-08-28 10:59  hopeless-dream  阅读(88)  评论(0编辑  收藏  举报