cat
- 语法
- 实例
- 补充
cat(英文全拼:concatenate)命令用于连接文件并打印到标准输出设备上。
语法
cat [-AbeEnstTuv] [--help] [--version] fileName
参数说明:
-n 或 --number:由 1 开始对所有输出的行数编号。
-b 或 --number-nonblank:和 -n 相似,只不过对于空白行不编号。
-s 或 --squeeze-blank:当遇到有连续两行以上的空白行,就代换为一行的空白行。
-v 或 --show-nonprinting:使用 ^ 和 M- 符号,除了 LFD 和 TAB 之外。
-E 或 --show-ends : 在每行结束处显示 $。
-T 或 --show-tabs: 将 TAB 字符显示为 ^I。
-A, --show-all:等价于 -vET。
**-e:**等价于"-vE"选项;
**-t:**等价于"-vT"选项;
实例
1)显示文件textfile1 里的内容
cat textfile1
2)把 textfile1 的文档内容加上行号后输入 textfile2 这个文档里:
cat -n textfile1 > textfile2
3)把 textfile1 和 textfile2 的文档内容加上行号(空白行不加)之后将内容附加到 textfile3 文档里:
cat -b textfile1 textfile2 >> textfile3
补充
concatenate | ||
---|---|---|
v. | 连接; 使连续(衔接)起来; 连锁; 串级; |
---|---|
adj. | 连在一起的; 连锁的; |
---|---|
[例句]Often, you need to concatenate a variable between two strings.
通常,您需要在两个字符串之间连接一个变量。
[其他] | 第三人称单数:concatenates 现在分词:concatenating 过去式:concatenated 过去分词:concatenated |
---|---|