PrepAway - Latest Free Exam Questions & Answers

Which of the following would do the same as the command cat file2.txt?

Which of the following would do the same as the command cat < file1.txt > file2.txt?

PrepAway - Latest Free Exam Questions & Answers

A.
cat < file1.txt file2.txt

B.
cat file1.txt >file2.txt

C.
cat <file1.txt | file2.txt

D.
cat file1.txt | file2.txt

E.
cp file1.txt>file2.txt

Explanation/Reference:
A) would make cat use the redirected stdin and file2.txt as input
C) would pipe the output to file2.txt, which could not read it
D) see C
E) cp does not display file1.txt so it would make no sense to redirect stdout


Leave a Reply