1. 取得进程号
cba001:/proc/26751/fd # ps -ef|grep named
root 17066 26915 0 13:06 pts/8 00:00:00 grep named
root 26751 1 0 Jul06 ? 00:02:06 /opt/***/***/usr/bin/named
[注]: 执行ps -ef|grep named取得named的进程号为26751
2.查看打开的文件
cba001:/proc/26751/fd # ls -al /proc/26751/fd/
total 20
dr-x------ 2 root vboxusers 0 Jul 21 12:48 .
dr-xr-xr-x 5 root vboxusers 0 Jul 6 10:25 ..
lrwx------ 1 root vboxusers 64 Jul 21 12:48 0 -> /dev/null
lrwx------ 1 root vboxusers 64 Jul 21 12:48 1 -> /dev/null
lr-x------ 1 root vboxusers 64 Jul 21 12:48 10 -> /dev/random
lrwx------ 1 root vboxusers 64 Jul 21 12:48 2 -> /dev/null
lrwx------ 1 root vboxusers 64 Jul 21 12:48 20 -> socket:/[64750499]
lrwx------ 1 root vboxusers 64 Jul 21 12:48 21 -> socket:/[64750501]
lrwx------ 1 root vboxusers 64 Jul 21 12:48 22 -> socket:/[64750503]
lrwx------ 1 root vboxusers 64 Jul 21 12:48 23 -> socket:/[64750506]
lrwx------ 1 root vboxusers 64 Jul 21 12:48 24 -> socket:/[64750507]
lrwx------ 1 root vboxusers 64 Jul 21 12:48 3 -> socket:/[64750437]
lrwx------ 1 root vboxusers 64 Jul 21 12:48 4 -> /dev/null
lr-x------ 1 root vboxusers 64 Jul 21 12:48 5 -> pipe:/[64750439]
lrwx------ 1 root vboxusers 64 Jul 21 12:48 512 -> socket:/[64750498]
lrwx------ 1 root vboxusers 64 Jul 21 12:48 513 -> socket:/[64750500]
lrwx------ 1 root vboxusers 64 Jul 21 12:48 514 -> socket:/[64750502]
lrwx------ 1 root vboxusers 64 Jul 21 12:48 515 -> socket:/[64750504]
lrwx------ 1 root vboxusers 64 Jul 21 12:48 516 -> socket:/[64750505]
l-wx------ 1 root vboxusers 64 Jul 21 12:48 7 -> pipe:/[64750439]
lrwx------ 1 root vboxusers 64 Jul 21 12:48 8 -> socket:/[64750441]
lrwx------ 1 root vboxusers 64 Jul 21 12:48 9 -> /var/***/logs/***_trans.log
[注]:执行ls -al /proc/26751/fd/就可以看到所有的26751进程打开的文件描述符