Ubuntu命令系列:file - 辨識指定文件的信息

file命令用於顯示指定文件的信息,好比指定文件是目錄、symbolic link,仍是具體的一個文件如plain text或可執行文件等。node

用法:python

file [-i|-L] <file name>linux

例子:bash

r@ubt:/$ file /usr/local
/usr/local: directory
r@ubt:/$ file /bin/nano
/bin/nano: ELF 64-bit LSB executable, x86-64, version 1 
(SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, 
for GNU/Linux 2.6.32, BuildID[sha1]=e87c5ab33de1e9e225244efd8e2a03f55892c98f, stripped
r@ubt:/$ file /usr/bin/python
/usr/bin/python: symbolic link to python2.7
r@ubt:/$ file -i /usr/bin/python
/usr/bin/python: inode/symlink; charset=binary
r@ubt:/$ file -iL /usr/bin/python
/usr/bin/python: application/x-executable; charset=binary

關於-i,-L開關的做用請自行體會。
app

相關文章
相關標籤/搜索