# cat -T testhello
^Ieveryone, how do you do?
Hey,
^Iam fine.
^I^IHow's your training
^Igoing on?
Let's dob Ibsome practice in Linux.
8. Display Multiple Files at OnceIn the below example we have three �les
test,
test1, and
test2, and able to view the contents of those �les as shown above. We need to separate each �le with
;(semicolon).
# cat test cat test cat test2This is a test file
This is the test file.
This is test file.
9. Use Standard Output with Redirection OperatorWe can redirect the standard output of ale into anew �le else existing �le with ab b (greater than) symbol. Careful, existing contents of the
test1 will be overwritten
by the contents of the test �le.
# cat test > test110. Appending Standard Output with RedirectionOperator
13 Basic Cat Command Examples in Linux Terminal https://www.tecmint.com/13-basic-cat-command-examp...
5 of 19 18/11/21, 13:40
Appends in existing �le with ‘
>>‘ (double greater than) symbol. Here, the contents of the
test �le will be appended at the end of the
test1 �le.
# cat test >> test111. Redirecting Standard Input with RedirectionOperatorWhen you use the redirect with standard input ‘
<‘ (less than symbol, it uses �le name
test2 as input for command and output will be shown in a terminal.
# cat < test2This is test file.
12. Redirecting Multiple Files Contain in a Single FileThis will create ale called
test3 and all output will be redirected in a newly created �le.
# cat test test test > test313. Sorting Contents of Multiple Files in a Single FileThis will create ale
test4 and the output of the cat command is piped to sort and the result will be redirected to a newly created �le.
# cat test test test test | sort > test4
13 Basic Cat Command Examples in Linux Terminal https://www.tecmint.com/13-basic-cat-command-examp...
6 of 19 18/11/21, 13:40