linux basic command file

file

Purpose: Identify the file type
Format:
file file name

Since we accepted Linux on the first day, it has been emphasized that all files are received under Linux.
Example:
file ~ / .bashrc is ASCII coded test type

book@www.100ask.org:~/linux/dira$ file ~/.bashrc
/home/book/.bashrc: ASCII text

file ~ / .vimrc is UTF-8 Unicode encoded test type
file ~ / Pictures / * Graphic file JPEG / PNG / BMP format

book@www.100ask.org:~/linux/dira$ file ~/Pictures/*
/home/book/Pictures/235113-1403260U22059.jpg: JPEG image data, JFIF standard 1.02, resolutio                                               n (DPI), density 72x72, segment length 16, baseline, precision 8, 1000x563, frames 3
/home/book/Pictures/534ce34bc9b13.png:        PNG image data, 1024 x 518, 8-bit/color RGB, n                                               on-interlaced
/home/book/Pictures/lehf1234.bmp:             PC bitmap, Windows 3.x format, 720 x 540 x 24
/home/book/Pictures/smplayer_screenshots:     directory

file ~ / 100ask / for directory indicates that this is a directory
file ~ / bin / pwd ELF 64-bit LSB executable appears, which is an executable file in ELF format

book@www.100ask.org:~/linux/dira$ file /bin/pwd
/bin/pwd: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpret                                               er /lib64/l, for GNU/Linux 2.6.32, BuildID[sha1]=aa7c30c99b95a56eb73eae57076d485a2d05a9c3, s                                               tripped

file / dev / * character special (character device file) appears

book@www.100ask.org:~/linux/dira$ file /dev/*
/dev/agpgart:            character special (10/175)
/dev/block:              directory
/dev/cdrom:              symbolic link to sr0
/dev/loop0:              block special (7/0)


Published 53 original articles · praised 16 · visits 2213

Guess you like

Origin blog.csdn.net/m0_37757533/article/details/105352921