win中是通过扩展名,区别文件类型(jpg,jpeg,png,gif/doc,txt,pdf/avi,wmv,mp4)

linux中文件类型和或者扩展名没有关联


linux的文件类型   

linux中一切皆文件:

       f(-)    regular file 普通文件

                普通文件类型:

                   1.纯文本文件(ASCII编码)    

                   2.二进制文件(binary)

                   3.数据类格式的文件

                       lastlog命令显示结果

       d    directory    目录文件

       l    symbolic link    软连接文件;soft link 类似win下的快捷方式,指向文件的实体

                 #ln -s /etc/passwd/root/test0511/passwd.link

                      lrwxrwxrwx. 1 root root   11 5月  13 01:02 passwd.link -> /etc/passwd

       s    socket文件,和进程间通信有关,例如mysql等的数据库的通信

       b    block(buffered) spercial    块文件(光驱、硬盘)

              # ll /dev/ |grep '^b'

                  brw-rw---- 1 root disk    253,   0 5月  12 2016 dm-0

                  brw-rw---- 1 root disk    253,   1 5月  12 2016 dm-1

       c    character    字符文件,一般串口类型的设备为字符文件

               mknod oldboy c 5 1    创建字符文件

       p    named pipe(FIFO)管道文件(很少用)

查看文件类型:

1

# file /bin/cp

/bin/cp: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0x930ba1b99a27112a3ce696993ee8b38556235df2, stripped

2

# file /etc/passwd

/etc/passwd: ASCII text

3

# file /dev/dm-0 

/dev/dm-0: block special

linux下的扩展名:

1.源码:.tar/.tar.gz/.tgz/.zip/.tar.bz

2.脚本文件:.sh   shell语言开发程序

3.perl脚本:.pl

4.python脚本:.py

5.网页语言文件:.html/.htm/.php/.jsp/.do

6.系统服务的配置文件:.conf

7.rpm安装包:.rpm