你好,这个是重定向符,还有类似的类似符号,定义如下:
cmd > file 把 stdout 重定向到 file 文件中;
cmd >> file 把 stdout 重定向到 file 文件中(追加);
cmd 1> fiel 把 stdout 重定向到 file 文件中;
cmd > file 2>&1 把 stdout 和 stderr 一起重定向到 file 文件中;
cmd 2> file 把 stderr 重定向到 file 文件中;
cmd 2>> file 把 stderr 重定向到 file 文件中(追加);
cmd >> file 2>&1 把 stderr 和 stderr 一起重定向到 file 文件中(追加);
cmd < file >file2 cmd 命令以 file 文件作为 stdin,以 file2 文件作为 stdout;
cat <>file 以读写的方式打开 file;
cmd < file cmd 命令以 file 文件作为 stdin;
cmd << delimiter Here document,从 stdin 中读入,直至遇到 delimiter 分界符。
对了,如果你够聪明,一看就明白了。
还不明白?行,打开终端输入如下命令看看:
echo hi greco > file.txt
cat file.txt
echo HI GRECO >> file.txt
cat file.txt
【来自:ubuntu中文网】

相关文章:

  • 2022-12-23
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
  • 2021-12-11
猜你喜欢
  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案