:: # cat ping.txt PING baidu.com (() bytes of data. bytes from ttl= time=32.1 ms bytes from ttl= time=31.3 ms bytes from ttl= time=31.8 ms --- baidu.com ping statistics --- packets transmitted, received, % packet loss, time 10154ms rtt min/avg/max/md…
stdin,stdout,stderr stdin=0 stdout=1 stderr=2 使用tee来传递内容,把stdout 作为stdin 传到下个命令 root@172-18-21-195:/tmp/pratice# echo "who is this" | tee - # -相当于传入到stdout,所以打印2次 who is this who is this root@172-18-21-195:/tmp/pratice# echo "who is this&qu…
内核使用3种数据结构表示打开的文件,他们之间的关系决定了在文件共享方面一个进程对另一个进程的影响. (1) 每个进程在进程表中都有一个纪录项,纪录项中包含一张打开文件描述符表,每个文件描述符各占一项,与每个文件描述符相关的是 a. 文件描述符标志 b. 指向一个文件表项的指针 (2) 内核为所有打开文件维护一张文件表项,每个文件表项包含: a. 文件状态(读 写 同步 非阻塞等) b. 当前文件偏移量 c. 指向改文件V节点(i节点)的指针 (3) 没打开一个文件或设备,都有一个V节点结构,V节…