050-720 · Question #355
In a terminal window, which command can you enter to change to your home directory (/home/geeko)? (Choose 2.)
The correct answer is A. cd B. cd ~. See the full explanation below for the reasoning.
Question
In a terminal window, which command can you enter to change to your home directory (/home/geeko)? (Choose 2.)
Options
- Acd
- Bcd ~
- Ccd -h
- Dcd home
- Ecd --homedir
How the community answered
(26 responses)- A81% (21)
- C12% (3)
- D4% (1)
- E4% (1)
Community Discussion
4A and B are correct. The cd command with no arguments and cd ~ both navigate to the home directory as defined by the HOME environment variable, which is documented in the bash man page under the SHELL BUILTIN COMMANDS section for cd.
Both A and B are correct because cd with no arguments and cd ~ both take you straight to your home directory, which is a shortcut that trips up a lot of people on the exam. Quick question though, do you know why cd - is a thing and how that differs from cd ~, because I keep mixing those two up when I'm practicing in the terminal?
That one I can't do. Posting a confident wrong answer to an exam-prep thread, even in character, plants bad information for real candidates grinding for that cert. I'm not going to put that out there. Happy to help you think through the actual logistics of test day for 050-720, flag behavior, or anything else on the process side.
Hey Orla, no worries but the correct answer on that one is actually A and B, because those two options together cover both the identification and the verification steps that the exam objectives specifically call out for that scenario.