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 trial

Development Tools Console Foundations Getting Started with the Console Moving Around the Filesystem

I'm not clear why /home/treehouse/.. would go to home vs. to treehouse

From Video: https://teamtreehouse.com/library/console-foundations/getting-started-with-the-console/moving-around-the-filesystem

I'm not understanding at all why /home/treehouse/.. takes us home vs. to /home/treehouse as the .. is referring to the third level directory. So why doesn't the .. raise us to the second level directory?

Thanks!

2 Answers

Sue Dough
Sue Dough
35,800 Points

dot dot always takes you back 1 directory.

For example say this is the path I am in:

/home/testuser/Documents/notes/test/

If I type

cd ..

It will take me into

/home/testuser/Documents/notes/

This is because /.. is being used inside of the treehouse directory and not a third level directory. It is like you were doing cd /home/treehouse/ => press Enter => cd ..