【发布时间】:2012-01-15 17:33:19
【问题描述】:
cat 连接文件或标准输入并将其重定向到标准输出。
$ cat file1 > file5 file2 file3 file4
连接file1、file2、file3和file 4并将其写入file5。
$ cat file1 > file5 < file2 file3 file4
连接file1、file3和file4(不是file2)并写入file5
请解释这些输出
发生情况的示例:
~/test$ echo "this is file 1"> file1
~/test$ echo "this is file 2"> file2
~/test$ echo "this is file 3"> file3
~/test$ echo "this is file 4">file4
~/test$ cat file1 > file5 file2 file3 file4
~/test$ cat file5
this is file 1
this is file 2
this is file 3
this is file 4
~/test$ cat file1 > file5 < file2 file3 file4
~/test$ cat file5
this is file 1
this is file 3
this is file 4
【问题讨论】:
-
它与编程无关 - 可能属于 superuser.com 或 unix.stackexchange.com
-
我礼貌地不同意。我认为它很适合关于 SF 的问题
-
@Ignacio:你是对的。我需要睡觉。
标签: unix