2019年5月18日 / 73次阅读
Linux
Linux环境中,一切都是文件,正好还有一个file命令程序,可以用来查看文件类型。
[xinlin@centos7 ~]$ file Python-3.7.1/setup.py
Python-3.7.1/setup.py: Python script, ASCII text executable
[xinlin@centos7 ~]$ file Python-3.7.1/Makefile
Python-3.7.1/Makefile: automake makefile script, ASCII text, with very long lines
[xinlin@centos7 ~]$ file Python-3.7.1
Python-3.7.1: directory
file查看文件和目录都可以。
[yihect@juliantec test]$ file sum.o sub.o test.o libsub.so test
sum.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
sub.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
test.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
libsub.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped
test: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped
我们试试用file命令来查看设备的情况:
[xinlin@centos7 ~]$ file /dev/tty1
/dev/tty1: character special
[xinlin@centos7 ~]$ file /dev/null
/dev/null: character special
[xinlin@centos7 ~]$ file /dev/zero
/dev/zero: character special
file命令还是有一些handy的参数可以选择,自己用man file查看吧。
本文链接:https://www.maixj.net/ict/file-21401
©Copyright 麦新杰 Since 2014 云上小悟独立博客版权所有 备案号:苏ICP备14045477号-1。云上小悟网站部分内容来源于网络,转载目的是为了整合信息,收藏学习,服务大家,有些转载内容也难以判断是否有侵权问题,如果侵犯了您的权益,请及时联系站长,我会立即删除。