快速业务通道

Linux基本操作实验(5)

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-03-26
显示,当然可以通过管道输出给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

Empire CMS,phome.net

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 忽略中断信号.

Empire CMS,phome.net

[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

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号