Difficulty: Easy
Correct Answer: ls
Explanation:
Introduction / Context:
The ability to list files and directories is foundational when working in Unix or Linux shells. Command-line navigation, file management, and scripting all begin with knowing which tool reveals directory contents reliably and flexibly. This question checks recognition of the standard command used across most Unix-like systems to display directory listings.
Given Data / Assumptions:
Concept / Approach:
The canonical Unix command for listing directory contents is ls. It supports numerous options for formatting (e.g., -l for long listing, -a to include hidden files, -h for human-readable sizes). While other operating systems (such as DOS/Windows) use dir, on Unix/Linux the primary tool is ls. Understanding this distinction prevents cross-platform confusion when switching between shells and terminals.
Step-by-Step Solution:
Verification / Alternative check:
Running ls prints the names of entries in the working directory. Using ls /etc lists contents of /etc, confirming the command's purpose.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
ls.
Discussion & Comments