20181207tee管道

tee 管道

20181207tee管道
[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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章