Operating Systems
A technician has moved through several directories with cd and needs the full path of the current location, not a listing of its contents. Which command should be used?
Show the answer
Correct answerB. pwd
AWhy not this: Lists the contents of the directory, which the technician said is not wanted.
BWhy this is right: Prints the absolute path of the current working directory and nothing else.
CWhy not this: Searches text for a pattern; it cannot report the current directory.
DWhy not this: Searches for files and returns matching entries, not the current location.
pwd prints the absolute path of the current working directory. ls tempts because it is a common navigation aid, but it lists contents instead of the path.