Tag: The file command uses
1 . Windows distinguish different files with different extensions, for example: . exe. PNG wait
2. There are no explicit requirements for extensions under Linux Sometimes you will encounter a variety of pits, when we do not know is a compressed file, with some commands to view the time, there will be various garbled
[email protected] ~]# cat text |head Y Noble 8о+ub.°@¤q:%durr) xs weak ±o§ 萞L 泏d2§ Infiltration 2c
3. use file to view files type
[[Email protected] ~]# file text
Text: gzip compressed Data, from Unix, last modified:wed 23 23:10:14 2017
[Email protected] ~]#
4. It can be seen that this is a compressed file, can be used,tar-tf View
[Email protected] ~]# Tar-tftext
Etc/services
[Email protected] ~]#
5. for a file with no extension, you can view the file type
[Email protected] ~]# file/bin/ls/etc/hosts ser.tar.gz
/bin/ls:elf 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for gnu/li Nux 2.6.18, stripped
/etc/hosts: asciitext
ser.tar.gz: gzipcompressed data, from Unix, last modified:wed 23 23:10:14 2017
[Email protected] ~]#
This article is from the "13091780" blog, please be sure to keep this source http://13101780.blog.51cto.com/13091780/1960896
How to use the file command under Linux