tee 管道

[root@tianyun ~]# ip addr |grep 'inet ' |tee ip.txt |awk -F"/" '{print $1}' |awk '{print $2}' 127.0.0.1 128.172.16.60.1 root@tianyun ~]# cat ip.txt inet 127.0.0.1/8 scope host lo net 172.16.60.1/24 brd 172.16.60.255 scope global eth0


[root@tianyun ~]# ip addr |grep 'inet ' |tee -a ip.txt |awk -F"/" '{print $1}' |awk '{print $2}' -a是追加的意思 127.0.0.1 172.16.60.1


[root@tianyun ~]# date >date.txt [root@tianyun ~]# date |tee date.txt

root@tianyun ~]# top -d 1 -b -n 1 > top.txt [root@tianyun ~]# top -d 1 -b -n 1 |tee top.txt