本文摘自PHP中文网,作者V,侵删。

区别:
linux中>表示覆盖原文件内容(文件的日期也会自动更新),>>表示追加内容(会另起一行,文件的日期也会自动更新)。
(推荐教程:linux教程)
举例:
1、将history命令执行的结果保存到history.log文件中
1 2 | [root@gxzs-solr1 ~]# history > history.log (history.log 文件 会自动生成)
[root@gxzs-solr1 ~]# cat history.log
|
2、执行命令 curl 'xxx' ,将其返回结果保存到 log.log 中
1 | [root@gx-solr1 ~]# curl 'http://192.168.0.110:8983/solr/scan_detail/admin/file?_=1544066402749&contentType=text/plain;charset=utf-8&file=managed-schema&wt=json' > log.log
|
3、执行命令 cat /etc/hosts , 将其返回结果保存到 hosts.log 中
阅读剩余部分
相关阅读 >>
Linux怎么打开
Linux系统使用入门教程
red hat Linux相关产品iso镜像下载
Linux操作系统安全加固的实例教程
Linux下telnet不能使用
Linux系统重启网卡的命令是什么
Linux查看系统进程
如何查看Linux服务
Linux如何计算目录中的文件数
最全的Linux下的压缩和解压zip、gz、tar、bz2文件命令(图文步骤详解)
更多相关阅读请进入《Linux》频道 >>
转载请注明出处:木庄网络博客 » linux中“<”和“<<”有什么区别