Where Core UNIX User Commands Reside In a typical UNIX filesystem layout, where are common commands such as date, ls, and cat stored?
-
A/dev directory
-
B/bin and /usr/bin directories
-
C/tmp directory
-
D/unix directory
-
ENone of the above
Answer
Correct Answer: /bin and /usr/bin directories
Explanation
Introduction / Context:UNIX organizes executable programs into standard directories so they are consistently available to all users and scripts. Knowing where core tools live helps with PATH configuration and system recovery tasks.
Given Data / Assumptions:
- Conventional UNIX or Linux filesystem hierarchy.
- System adheres to historical paths for user commands.
- Basic tools are accessible to regular users.
Concept / Approach:Essential binaries needed for single-user mode or early boot often live in /bin. Additional user commands and utilities are stored in /usr/bin. This division ensures a minimal toolset is available even if /usr is on a separate partition not yet mounted.
Step-by-Step Solution:Check which ls and which date to see their locations.Observe that they resolve to /bin/ls or /usr/bin/ls depending on the distribution.Confirm similar placement for cat.
Verification / Alternative check:Examine PATH with echo $PATH and list the directories. Use ls -l /bin /usr/bin to see the installed command catalogs.
Why Other Options Are Wrong:/dev contains device nodes, not general commands./tmp is for temporary files./unix is not a standard directory for user commands (legacy systems might use different kernel names/paths).
Common Pitfalls:
- Assuming all commands are in one directory; PATH often aggregates several.
- Overwriting critical tools in
/bincan break recovery shells.
Final Answer:/bin and /usr/bin directories