查看文件所打开的文件句柄

[root@web02 ~]# tail anaconda-ks.cfg -f

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end

%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
^Z
[1]+  Stopped                 tail anaconda-ks.cfg -f
[root@web02 ~]# ps aux |grep tail
root      83053  0.0  0.0 107992   620 pts/0    T    12:41   0:00 tail anaconda-ks.cfg -f
root      83061  0.0  0.0 112708   976 pts/0    R+   12:41   0:00 grep --color=auto tail
[root@web02 ~]# ll /proc/83053/fd/
total 0
lrwx------ 1 root root 64 Jan  2 12:42 0 -> /dev/pts/0
lrwx------ 1 root root 64 Jan  2 12:42 1 -> /dev/pts/0
lrwx------ 1 root root 64 Jan  2 12:41 2 -> /dev/pts/0
lr-x------ 1 root root 64 Jan  2 12:42 3 -> /root/anaconda-ks.cfg
lr-x------ 1 root root 64 Jan  2 12:42 4 -> anon_inode:inotify

0代表标准错误输入
1代表标准输出
2代表错误输出
3代表文件
4代表anon_inodefs 是为了公共需求抽离出来的一个内核文件系统,只有一个 inode ,为了节省内存,抽象重复代码之用
posted @ 2022-01-02 13:04  小树成长记  阅读(254)  评论(0编辑  收藏  举报