You work as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based
network. Rick, a Sales Manager, wants to combine the contents of the Sale1.txt and Sale2.txt files
to
a new file named FinSale.txt. Which of the following commands will he use to accomplish the
task?
A.
ls Sale1.txt Sale2.txt < FinSale.txt
B.
cat Sale1.txt Sale2.txt < FinSale.txt
C.
ls Sale1.txt Sale2.txt > FinSale.txt
D.
cat Sale1.txt Sale2.txt > FinSale.txt
Explanation:
The concatenate (cat) command is used to display or print the contents of a file.
Syntax:
cat filename
For example, the following command will display the contents of the /var/log/dmesg file:
cat /var/log/dmesg
Note: The more command is used in conjunction with the cat command to prevent scrolling of the
screen while displaying the contents of a file.