美文网首页
shell编程1.3: 文件与重定向

shell编程1.3: 文件与重定向

作者: 赵伯舟 | 来源:发表于2018-09-10 21:16 被阅读11次

1. 文件描述符

shell内的文件描述符对应为:0-stdin, 1-stdout, 2-stderr

2. 重定向

使用>>>进行重定向,其中>是重写,而>>是追加:

$ echo "This is a sample text 1" > temp.txt

$ echo "This is a sample text 2" >> temp.txt

相关文章

网友评论

      本文标题:shell编程1.3: 文件与重定向

      本文链接:https://www.haomeiwen.com/subject/qxdegftx.html