Which of the following commands can John use to join the splitted files into a new data.txt file?

John works as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based
network. John is working as a root user on the Linux operating system. He wants to break a dat
a.txt file, 200MB in size, into two files in which the size of the first file named data.txt.aa should
be150MB and that of the second file named data.txt.ab should be 50MB. To accomplish his task
and to further delete the data.txt file, he enters the following command: split –verbose -b 150m
data.txt data.txt. ; rm -vf data.txt
Which of the following commands can John use to join the splitted files into a new data.txt file?

John works as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based
network. John is working as a root user on the Linux operating system. He wants to break a dat
a.txt file, 200MB in size, into two files in which the size of the first file named data.txt.aa should
be150MB and that of the second file named data.txt.ab should be 50MB. To accomplish his task
and to further delete the data.txt file, he enters the following command: split –verbose -b 150m
data.txt data.txt. ; rm -vf data.txt
Which of the following commands can John use to join the splitted files into a new data.txt file?

A.
vi data.txt.*

B.
less data.txt.* > data.txt

C.
cat data.txt.* > data.txt

D.
vi data.txt.* > data.txt

Explanation:

The cat data.txt.* command will display both the splitted files, and the > command will redirect the
output into a new data.txt file.
What is the cat command?
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.
What is > command?
The > command is used for storing the output generated by different commands. It creates a file
specified to store the output. If the specified file already exists, it overwrites that file.
Answer option A is incorrect. This command will open a new file data.txt.* into the vi editor.

Answer option D is incorrect. This command will give the vi editor a warning “output is not to a
terminal” since the vi terminal cannot be redirected into the data.txt file.
Answer option B is incorrect. The less command displays only the first file data.txt.aa, and the >
command redirects the output into the data.txt file. Hence, John will not get the desired output
using this command.



Leave a Reply 0

Your email address will not be published. Required fields are marked *