7.1 管道、重定向
来源:互联网 发布:mac win8u盘安装 编辑:程序博客网 时间:2024/06/10 07:44
1.shell命令行 的数据流定义
STDIN : 标准输入(键盘) 编号0
STDOUT: 标准输出(终端) 编号1
STDERR: 标准输出(终端) 编号2
2.重定向
syntax: >
desc: 将STDOUT重定向到文件(覆盖)
eg: echo "hellow" > outfile
ls > outfile
syntax: >>
desc: 将STDOUT重定向到文件(追加)
eg: echo "hellow" >> outfile
date >> outfile
syntax: 2>
desc: 将STDERR重定向到文件(覆盖)
eg: ls nothere 2> errorfile
syntax: 2>$1
desc: 将STDOUT 和 STDERR重定向到文件(覆盖)
eg: ls nothere 2>&1 alloutput
syntax: <
desc: 重定向STDIN
eg: grep linuxcast < /etc/passwd
3.管道
syntax: |
desc 将一个命令的stdout 作为另一个命令的 STDIN
eg: ls -l | grep linuxcast
find /-usr linuxcast | grep video
STDIN : 标准输入(键盘) 编号0
STDOUT: 标准输出(终端) 编号1
STDERR: 标准输出(终端) 编号2
2.重定向
syntax: >
desc: 将STDOUT重定向到文件(覆盖)
eg: echo "hellow" > outfile
ls > outfile
syntax: >>
desc: 将STDOUT重定向到文件(追加)
eg: echo "hellow" >> outfile
date >> outfile
syntax: 2>
desc: 将STDERR重定向到文件(覆盖)
eg: ls nothere 2> errorfile
syntax: 2>$1
desc: 将STDOUT 和 STDERR重定向到文件(覆盖)
eg: ls nothere 2>&1 alloutput
syntax: <
desc: 重定向STDIN
eg: grep linuxcast < /etc/passwd
3.管道
syntax: |
desc 将一个命令的stdout 作为另一个命令的 STDIN
eg: ls -l | grep linuxcast
find /-usr linuxcast | grep video
阅读全文
0 0
- 7.1 管道、重定向
- 管道重定向
- 重定向与管道
- 管道重定向符“|”
- 重定向 与 管道
- 管道重定向符“|”
- 管道和重定向
- linux重定向、管道
- 管道与重定向
- 重定向与管道
- 重定向和管道
- 管道和重定向
- 管道和重定向
- 管道和重定向
- 重定向和管道
- shell重定向,管道
- 管道与重定向
- linux 管道重定向
- K-means聚类
- 关于Activiti多级审批自动绘图以及修改class方面的经验
- 5.用户及权限
- MAC环境如何将本地代码上传到GitHub上
- Object.create()方法的使用
- 7.1 管道、重定向
- Map的KEY值转成大写
- 实体类对象与XML字符串的序列化和反序列化(示例)
- 7.2 Linux 命令行文本处理
- 最佳日志数据实践
- windows 的常用命令
- iterm2 ssh共享socket支持动态免密登录
- [程序员面试金典]-链表分割
- 05.03 Linux安装系统优化部分