Learn
Navigation
cd II

Instead of using cd twice in order to move from 2015 to memory, we can use it once and give it a longer argument:

$ cd jan/memory

To navigate directly to a directory, use cd with the directory’s path as an argument. Here, cd jan/memory navigates directly to the memory directory.

To move up one directory, we use cd ..:

$ cd ..

Here, cd .. navigates up from jan/memory/ to jan/.

Instructions

1.

We are currently in /home/ccuser/workspace/blog (you can check your location at any time using pwd). Change the directory to the 2015/feb/ directory using:

$ cd 2015/feb

This brings us down one level to 2015 and then down once more into the feb directory.

2.

Now we’re in 2015/feb, but what if we want to move to 2015/jan? (You can reference the filesystem for this lesson here.)

This means that we have to go back up one level (to 2015), and then down into the jan directory. This could be accomplished using two distinct cd commands (one that moves us up and then another that moves us back down), but we’re going to do it using just one command.

Using a single cd command, navigate from 2015/feb to 2015/jan.

3.

Navigate back to /home/ccuser/workspace/blog using a single cd command.

Folder Icon

Sign up to start coding

Already have an account?