官方的帮助文档:

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


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  实现复制,当然此用法下小心覆盖已有的文件。