Difficulty: Easy
Correct Answer: cat
Explanation:
Introduction / Context:
Unix utilities excel by doing one thing well and composing with redirection and pipelines. The classic tool for displaying file contents is also frequently used to create simple files by redirecting its output. Recognizing this pattern helps with quick notes, logs, and test data without invoking a full-screen editor.
Given Data / Assumptions:
Concept / Approach:
cat (concatenate) prints files to standard output. Combined with redirection, it can create files: for example, cat > notes.txt then typing lines and pressing CTRL+D saves the content. It can also join multiple files: cat a.txt b.txt > both.txt. Editors like vi and ed can create files too, but the question emphasizes a command used to display and—via shell features—create files quickly.
Step-by-Step Solution:
Verification / Alternative check:
After creation, confirm with ls -l new.txt and cat new.txt to view the contents. This demonstrates both display and create behaviors in practice.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
cat.
Discussion & Comments