2014-05-10 15:23:41 +03:00
|
|
|
# cat
|
|
|
|
|
|
|
|
> Print and concatenate files.
|
2021-04-01 17:54:26 +02:00
|
|
|
> More information: <https://www.gnu.org/software/coreutils/cat>.
|
2014-05-10 15:23:41 +03:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Print the contents of a file to the standard output:
|
2014-05-10 15:23:41 +03:00
|
|
|
|
2022-10-01 10:11:48 +00:00
|
|
|
`cat {{path/to/file}}`
|
2014-05-10 15:23:41 +03:00
|
|
|
|
2022-10-01 10:11:48 +00:00
|
|
|
- Concatenate several files into an output file:
|
2014-05-10 15:23:41 +03:00
|
|
|
|
2022-10-01 10:11:48 +00:00
|
|
|
`cat {{path/to/file1}} {{path/to/file2}} > {{path/to/output_file}}`
|
2015-12-29 18:45:42 -08:00
|
|
|
|
2022-10-01 10:11:48 +00:00
|
|
|
- Append several files into an output file:
|
2015-12-29 18:45:42 -08:00
|
|
|
|
2022-10-01 10:11:48 +00:00
|
|
|
`cat {{path/to/file1}} {{path/to/file2}} >> {{path/to/output_file}}`
|
2016-01-18 22:23:18 +08:00
|
|
|
|
|
|
|
- Number all output lines:
|
|
|
|
|
2022-10-01 10:11:48 +00:00
|
|
|
`cat -n {{path/to/file}}`
|
2019-07-03 03:52:13 +01:00
|
|
|
|
|
|
|
- Display non-printable and whitespace characters (with `M-` prefix if non-ASCII):
|
|
|
|
|
2022-10-01 10:11:48 +00:00
|
|
|
`cat -v -t -e {{path/to/file}}`
|