ACE-P-ALE1-04 practice question 7 of 35

Which utility can be used to merge sequentially corresponding lines of input streams into a single output stream?

Full set: 100 questions
Answer options
A: sort
B: cut
C: paste Correct answer
D: diff
E: grep
Correct Answer:
C. paste
Explanation

The paste utility is the standard command-line tool for merging files horizontally. It reads from multiple input files and joins their corresponding lines side-by-side, writing the result to standard output. By default, it uses a tab character as a delimiter between the columns formed from each input file. This functionality directly matches the requirement of merging sequentially corresponding lines from input streams into a single output stream.

Why Incorrect

A. sort: This utility arranges lines of text files in a specified order; it does not merge files side-by-side.
B. cut: This utility extracts specific sections (columns or fields) from each line of a file; it does not combine multiple files.
D. diff: This utility compares files line by line to identify and display their differences, rather than merging them.
E. grep: This utility searches for lines containing a specified pattern within text files; it does not perform any merging function.

References

1. GNU Coreutils Manual: The official documentation for the paste command explicitly states its function: "The paste command merges the given files, joining their corresponding lines side-by-side, separated by tabulators."

Source: Free Software Foundation, GNU Coreutils Manual, Section 14.2, "paste: merge lines of files."

2. University Courseware: Reputable computer science courses cover fundamental shell utilities. The paste command is often taught as a primary tool for data manipulation and file merging.

Source: MIT, "The Missing Semester of Your CS Education," Lecture 2: Shell Tools and Scripting. The lecture materials describe paste as a tool for joining lines of files.

Scroll to Top