2014-05-10 13:23:41 +01:00
|
|
|
# cat
|
|
|
|
|
|
|
|
> Print and concatenate files.
|
|
|
|
|
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
|
|
|
|
2015-12-30 02:45:42 +00:00
|
|
|
`cat {{file}}`
|
2014-05-10 13:23:41 +01:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Concatenate several files into the target file:
|
2014-05-10 13:23:41 +01:00
|
|
|
|
2016-07-22 21:24:06 +01:00
|
|
|
`cat {{file1}} {{file2}} > {{target_file}}`
|
2015-12-30 02:45:42 +00:00
|
|
|
|
2016-01-18 14:23:18 +00:00
|
|
|
- Append several files into the target file:
|
2015-12-30 02:45:42 +00:00
|
|
|
|
2016-07-22 21:24:06 +01:00
|
|
|
`cat {{file1}} {{file2}} >> {{target_file}}`
|
2016-01-18 14:23:18 +00:00
|
|
|
|
|
|
|
- Number all output lines:
|
|
|
|
|
|
|
|
`cat -n {{file}}`
|
2019-07-03 03:52:13 +01:00
|
|
|
|
|
|
|
- Display non-printable and whitespace characters (with `M-` prefix if non-ASCII):
|
|
|
|
|
|
|
|
`cat -v -t -e {{file}}`
|