2.4-Linux文件类型

文件类型

类型解释
d目录
普通文件和命令
c字符串设备(键盘、鼠标之类)
b块设备(光驱、磁盘之类)
s通信
l软链接文件

权限里的第一位,是文件类型

[root@evan-01 /]# ls -la
总用量 24
dr-xr-xr-x.  20 root root  281 7月  27 2018 .
dr-xr-xr-x.  20 root root  281 7月  27 2018 ..
-rw-r--r--    1 root root    0 7月  12 2018 .autorelabel
lrwxrwxrwx.   1 root root    7 5月  28 2018 bin -> usr/bin
dr-xr-xr-x.   4 root root 4096 5月  28 2018 boot
drwxr-xr-x    5 root root   62 8月  28 2018 data
drwxr-xr-x   20 root root 3360 8月   7 14:44 dev
drwxr-xr-x.  93 root root 8192 8月   7 14:44 etc
drwxr-xr-x.  13 root root  162 9月  14 2018 home
lrwxrwxrwx.   1 root root    7 5月  28 2018 lib -> usr/lib
lrwxrwxrwx.   1 root root    9 5月  28 2018 lib64 -> usr/lib64
drwxr-xr-x.   2 root root    6 11月  5 2016 media
drwxr-xr-x.   2 root root    6 11月  5 2016 mnt
drwxr-xr-x.   2 root root    6 11月  5 2016 opt
dr-xr-xr-x  199 root root    0 8月   7 14:43 proc
dr-xr-x---.  20 root root 4096 1月  16 2019 root
drwxr-xr-x   26 root root  860 8月   7 14:45 run
lrwxrwxrwx.   1 root root    8 5月  28 2018 sbin -> usr/sbin
drwxr-xr-x.   2 root root    6 11月  5 2016 srv
dr-xr-xr-x   13 root root    0 8月   7 14:44 sys
drwxr-xr-x.   2 root root   19 6月  25 2018 test
drwxr-xr-x    2 root root   33 7月  18 2018 test2
drwxrwxrwt    8 root root  220 8月   7 14:48 tmp
drwxr-xr-x.  13 root root  155 5月  28 2018 usr
drwxr-xr-x.  21 root root 4096 8月   7 14:44 var
[root@evan-01 /]# 

cat 查看普通文件
普通文本文档可以用cat命令查看,绿色文件(二进制文件)是被编译过的文件,无法查看,类似的还有.exe文件都是无法查看的

[root@evan-01 ~]# touch test.txt
[root@evan-01 ~]# echo "this is a test" > test.txt
[root@evan-01 ~]# cat test.txt 
this is a test
[root@evan-01 ~]# 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值