Operating Systems

A technician must send the contents of two small text files, notes1.txt and notes2.txt, to the terminal as one continuous output. Which command does this?

Show the answer

Correct answerA. cat notes1.txt notes2.txt

AWhy this is right: cat concatenates the named files and prints their contents one after another.

BWhy not this: du accepts file names but reports the disk space they use, not what they contain.

CWhy not this: ps lists processes and does not read or print files.

DWhy not this: man looks for manual pages named after the arguments, not the contents of text files.

cat concatenates the files given as arguments and writes their contents to standard output in order. The du command is tempting because it accepts file names, but it reports disk space used, not file contents.