echo、read、tee、标准输入0、输出1、错误输出2、重定向>、追加重定向>>

来源:互联网 发布:mysql 5.1.59.tar.gz 编辑:程序博客网 时间:2024/06/01 07:32
1.echo "who are you:\c" 不换行
2.echo "who are you:\n\n\n"换行
3.echo "who are you:" 换行
4.echo -n “who are you:” 换行
5.echo -e "you are connected `tty`" 里面有\转义符或者shell命令需要用-e


1.echo "please input your name:\c"
   read name
   echo $name


1.管道 |
  ls | grep 1.doc


1.tee 对执行命令的保存,累死重定向
   who | tee -a who.out    -a表示追加

1.标准输出
command >>filename 2>&1  
command < filename
command <&-   关闭标准输入
grep "triden" missiles  2>/dev/null
grep "triden" missiles  2>grep.err

1.ls > myfile
2.ls >>myfile 追加

0 0
原创粉丝点击