2014-05-10 13:23:41 +01:00
|
|
|
# cat
|
|
|
|
|
|
|
|
> Print and concatenate files.
|
2021-04-01 16:54:26 +01:00
|
|
|
> More information: <https://www.gnu.org/software/coreutils/cat>.
|
2014-05-10 13:23:41 +01:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Print the contents of a file to the standard output:
|
2014-05-10 13:23:41 +01:00
|
|
|
|
2022-10-01 11:11:48 +01:00
|
|
|
`cat {{path/to/file}}`
|
2014-05-10 13:23:41 +01:00
|
|
|
|
2022-10-01 11:11:48 +01:00
|
|
|
- Concatenate several files into an output file:
|
2014-05-10 13:23:41 +01:00
|
|
|
|
2022-12-21 03:18:13 +00:00
|
|
|
`cat {{path/to/file1 path/to/file2 ...}} > {{path/to/output_file}}`
|
2015-12-30 02:45:42 +00:00
|
|
|
|
2022-12-21 03:18:13 +00:00
|
|
|
- Append several files to an output file:
|
2015-12-30 02:45:42 +00:00
|
|
|
|
2022-12-21 03:18:13 +00:00
|
|
|
`cat {{path/to/file1 path/to/file2 ...}} >> {{path/to/output_file}}`
|
2016-01-18 14:23:18 +00:00
|
|
|
|
2022-12-21 03:18:13 +00:00
|
|
|
- Copy the contents of a file into an output file without buffering:
|
2016-01-18 14:23:18 +00:00
|
|
|
|
2022-12-21 03:18:13 +00:00
|
|
|
`cat -u {{/dev/tty12}} > {{/dev/tty13}}`
|
2019-07-03 03:52:13 +01:00
|
|
|
|
2022-12-21 03:18:13 +00:00
|
|
|
- Write `stdin` to a file:
|
2019-07-03 03:52:13 +01:00
|
|
|
|
2022-12-21 03:18:13 +00:00
|
|
|
`cat - > {{path/to/file}}`
|