47 Comments The cat short for “concatenate



Download 99.6 Kb.
View original pdf
Page5/5
Date23.11.2021
Size99.6 Kb.
1   2   3   4   5
# cat -T test
hello ^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 Once
In 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 test2
This is a test file
This is the test file.
This is test file.
9. Use Standard Output with Redirection Operator
We 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 > test1
10. Appending Standard Output with Redirection
Operator

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 >> test1
11. Redirecting Standard Input with Redirection
Operator
When 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 < test2
This is test file.
12. Redirecting Multiple Files Contain in a Single File
This will create ale called test3 and all output will be redirected in a newly created �le.
# cat test test test > test3
13. Sorting Contents of Multiple Files in a Single File
This 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

Download 99.6 Kb.

Share with your friends:
1   2   3   4   5




The database is protected by copyright ©ininet.org 2020
send message

    Main page