101-500 Exam QuestionsBrowse all questions from this exam

101-500 Exam - Question 97


Which of the following commands print the current working directory when using a Bash shell? (Choose two.)

Show Answer
Correct Answer: AD

To print the current working directory in a Bash shell, you can use the command 'pwd', which stands for 'print working directory'. Another way is to use 'echo' with the environment variable '${PWD}', which holds the current working directory path. Therefore, both 'echo "${PWD}"' and 'pwd' are correct commands to achieve this.

Discussion

2 comments
Sign in to comment
AmycertOption: D
Feb 8, 2023

only pwd and echo $PWD would work. but pwd is the only answer provided

catita3Options: AD
Mar 15, 2023

echo ${PWD} works as well