意见箱
恒创运营部门将仔细参阅您的意见和建议,必要时将通过预留邮箱与您保持联络。感谢您的支持!
意见/建议
提交建议

Linux命令-cat

来源:恒创科技 编辑:恒创科技编辑部
2024-02-02 06:52:59


官方的帮助文档:

Usage: cat [OPTION]... [FILE]...


Linux命令-cat


Concatenate FILE(s), or standard input, to standard output.



-A, --show-all equivalent to -vET

-b, --number-nonblank number nonempty output lines

-e equivalent to -vE

-E, --show-ends display $ at end of each line

-n, --number number all output lines

-s, --squeeze-blank suppress repeated empty output lines

-t equivalent to -vT

-T, --show-tabs display TAB characters as ^I

-u (ignored)

-v, --show-nonprinting use ^ and M- notation, except for LFD and TAB

--help display this help and exit

--version output version information and exit




With no FILE, or when FILE is -, read standard input.


官方给出的解释是,把文件或标准输入,与标准输出连接起来。

cat 全称 Concatenate[kɒn'kætɪneɪt]

使用方式:cat [-AbeEnstTuv] [--help] [--version] fileName

参数都是可选的,直接 cat fileName 也可以输出文件内容,参数只是为了控制输出的格式

比较重要的我们一定要记住:

cat --version 显示当前cat命令的版本信息

cat --help 显示帮助信息。

高级用法 cat 或 cat - 命令行会等接收标准输入

输出重定向:

cat file1.txt | file2.txt 会把file1 中的内容输出到 file2 实现复制,当然此用法下小心覆盖已有的文件。






上一篇: php phar的创建与使用 下一篇: 手机怎么远程登录云服务器?