Which command is used to display the current directory in UNIX?
a) pwd
b) ls
c) cd
d) dir
Answer:
a) pwd
Explanation:
The pwd
command in UNIX is used to print the current working directory. It stands for “print working directory,” and its function is to show the full path of the directory you are currently in. This command is extremely helpful when navigating through the file system.
When using UNIX systems, navigating directories is a common task. Knowing your current directory helps avoid confusion when you are working in complex directory structures. The pwd
command ensures that users are aware of their position in the file system.
Understanding how to use the pwd
command is one of the first steps in becoming proficient in UNIX. As you work with different files and directories, you’ll find yourself using pwd
regularly to confirm your location.