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 trialrajbee
6,657 PointsMoving up a directory tree ?
To move up one directory, use cd .. To move up 2 levels, use cd ../../ Why do we need to use the / ? Why cant we use .. multiple times instead ?
2 Answers
William Li
Courses Plus Student 26,868 PointsHi there,
I believe the case that David Tonge mentioned, directory name with a space, we use backslash as escape character, not forward slash.
In UNIX, forward slash is used strictly as directory path separator; for example, /home/name/.rvm/rubies/ruby-2.2.1/bin/ruby
.
When you see couple dots .. in between //, that means navigate one level up to the current directory's parent directory. This notation comes up quite often when loading a source file (image/css/js) into a HTML page.
Hope this helps.
David Tonge
Courses Plus Student 45,640 PointsI think in the case of using the terminal the "/" is kind of an escape character. You can't use spaces in the terminal. Let's say I wanted cd to a directory named "Raj S" i'd have to put in quotes by using cd "Raj S" or using escape characters. So in your case using cd ../../ is kind of an shortcut instead of using cd .. cd .. twice.
David Tonge
Courses Plus Student 45,640 PointsDavid Tonge
Courses Plus Student 45,640 PointsThanks for the added information. I guess my wording and a slight mix up between the two characters totally threw it off.