读入数据:input
输出数据:output
打开的文件都有一个fd:file descriptor 文件描述符
Linux给程序提供三种I/O设备
[root@centos7 proc]# echo $$
2199
[root@centos7 proc]# ll /proc/$$/fd
总用量 0
lrwx------. 1 root root 64 10月 19 20:09 0 -> /dev/pts/0
lrwx------. 1 root root 64 10月 19 20:09 1 -> /dev/pts/0
lrwx------. 1 root root 64 10月 19 20:09 2 -> /dev/pts/0
lrwx------. 1 root root 64 10月 19 20:22 255 -> /dev/pts/0
[root@centos7 proc]#
[root@centos7 proc]# ll /proc/self/fd
总用量 0
lrwx------. 1 root root 64 10月 19 20:25 0 -> /dev/pts/0
lrwx------. 1 root root 64 10月 19 20:25 1 -> /dev/pts/0
lrwx------. 1 root root 64 10月 19 20:25 2 -> /dev/pts/0
lr-x------. 1 root root 64 10月 19 20:25 3 -> /proc/2222/fd
原文:https://blog.51cto.com/abyssce/2542531