Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDon Chedele
7,676 PointsConfused about Console question.
Which of these commands will NOT take you to your home directory, assuming your username is treehouse?
- cd /home/treehouse
- cd $HOME
- cd ~
- cd /home
I choose cd $HOME the first time thinking that was the answer, but it's cd /home.
I even tried cd /home in the console and it works! cd $HOME however doesn't work.
Any explanations?
Here's the link
4 Answers
Nathan Williams
Python Web Development Techdegree Student 6,851 PointsHi Dustin,
The key phrase there is "your home directory". '/home' is where all system user homes are created, but not your home directory. An individual user home is typically /home/username
.
Hope that helps!
Nathan W
Nathan Williams
Python Web Development Techdegree Student 6,851 PointsHi Dustin,
$HOME
is a per-user environment variable set in bash which translates to the user's home, which is not the same as the path /home
. I'm not sure why cd $HOME
wouldn't have worked, assuming you were in a bash shell.
Regards,
Nathan W
Don Chedele
7,676 PointsIt's asking which one wouldn't take you to the home directory though.
I didn't see anything mentioned about cd $HOME
Don Chedele
7,676 PointsOk, I see what I was doing wrong.
I had it like treehouse ~/documents $ HOME
,
when it should of been treehouse ~/documents $ cd $HOME
.