2020-11-04 20:12:56 +00:00
|
|
|
# cat
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
> 打印和拼接文件的工具。
|
2021-08-31 08:13:49 +01:00
|
|
|
> 更多信息:<https://www.gnu.org/software/coreutils/cat>.
|
2020-11-04 20:12:56 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 以标准输出,打印文件内容:
|
2020-11-04 20:12:56 +00:00
|
|
|
|
|
|
|
`cat {{file}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 多文件合并到目标文件:
|
2020-11-04 20:12:56 +00:00
|
|
|
|
|
|
|
`cat {{file1}} {{file2}} > {{target_file}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 多文件合并,并追加到目标文件:
|
2020-11-04 20:12:56 +00:00
|
|
|
|
|
|
|
`cat {{file1}} {{file2}} >> {{target_file}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 显示行号:
|
2020-11-04 20:12:56 +00:00
|
|
|
|
|
|
|
`cat -n {{file}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 显示不可打印和空白的字符(使用 `M-` 前缀标记非 ASCII 字符):
|
2020-11-04 20:12:56 +00:00
|
|
|
|
|
|
|
`cat -v -t -e {{file}}`
|