» Linux » Examen sur Linux » Examen 201 : Advanced Administration » Section 2 » Question 13/20
13.Using command substitution, how would you display the value of the present working directory?

echo $(pwd)
echo pwd
$pwd
pwd | echo

Explanation: The echo command can be used to display the contents of variables. The present working directory is held in the pwd variable. Echo $(pwd) will display the contents of the pwd variable. Other commands that would work are echo $ PWD and echo "$PWD".

Reference: http://www.bolthole.com/solaris/ksh-beforeyoustart.html

Incorrect Answers:
B: Echo pwd would display the text 'pwd'.
C: $pwd doesn't do anything although $PWD would work.
D: pwd | echo doesn't do anything.
« Question 12 Question 14 »