显示,当然可以通过管道输出给more或head,less等. [root@windriver-machine shtest]# cat myfile The log files have all been done [root@windriver-machine shtest]# read -e myfile ll [root@windriver-machine shtest]# read -e myfile testfile [root@windriver-machine shtest]# ls 1234 1234.txt 123abc errors ex1.sh myfile newerr output testoutput testoutput2 [root@windriver-machine shtest]# cp myfile myfile1 [root@windriver-machine shtest]# cat myfile The log files have all been done [root@windriver-machine shtest]# cat myfile myfile1 The log files have all been done The log files have all been done [root@windriver-machine shtest]# cat Hello world Hello world hello world hello world [root@windriver-machine shtest]# cat >myfile2 This is great [root@windriver-machine shtest]# cat myfile2 This is great [root@windriver-machine shtest]# cat -n /etc/passwd 1 root:x:0:0:root:/root:/bin/bash 2 bin:x:1:1:bin:/bin:/sbin/nologin 3 daemon:x:2:2:daemon:/sbin:/sbin/nologin 4 adm:x:3:4:adm:/var/adm:/sbin/nologin 5 lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 6 sync:x:5:0:sync:/sbin:/bin/sync 7 shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 8 halt:x:7:0:halt:/sbin:/sbin/halt 9 mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 10 news:x:9:13:news:/etc/news: [root@windriver-machine shtest]# cat -n myfile 1 The log files have all been done [root@windriver-machine shtest]# cat -n myfile1 >myfile myfile myfile1 myfile2 [root@windriver-machine shtest]# cat -n myfile1 >myfile3 [root@windriver-machine shtest]# cat myfile3 1 The log files have all been done [root@windriver-machine shtest]# vi myfile1 [root@windriver-machine shtest]# cat -n myfile1 1 The log files have all been done 2 3 4 This is other line to do verify work [root@windriver-machine shtest]# cat -b myfile1 1 The log files have all been done 2 This is other line to do verify work [root@windriver-machine shtest]# cat myfile2 This is great [root@windriver-machine shtest]# cat /dev/null >myfile2 [root@windriver-machine shtest]# cat myfile2 [root@windriver-machine shtest]# 【4】tee 会从标准输入设备读取数据,并将其内容输出到标准输出设备,同时保存成文件. –a 附加到现有文件中.-i 忽略中断信号. [root@windriver-machine shtest]# cat myfile1|tee myfile1.bak1 myfile1.bak2 myfile1.bak3 The log files have all been done This is other line to do verify work This is tab\tcontrol [root@windriver-machine shtest]# ll total 52 lrwxrwxrwx 1 root root 8 2011-08-06 22:07 1234 -> 1234.txt -rw-r--r-- 1 root root 0 2011-08-07 01:43 1234.txt drwsr-sr-x 2 windriver windriver 4096 2011-08-06 21:24 123abc -rw-rw-r-- 2 windriver windriver 74 2011-08-06 22:11 |