2.7. Additional Practice¶
Suppose that you are working directly inside of your home directory
on Odin, execute the tree
command, and observe the output below:

If
/home/users/user
is the absolute path to your home directory, then which of the commands shown below would move you directly into thecs1730
directory? Select all that apply.cd /home/users/user/cs1302-unix/notes/cs1730
cd ~/cs1302-unix/notes/cs1730
cd cs1730
cd ~/cs1730
cd cs1302-unix/notes/cs1730
cd /cs1302-unix/notes/cs1730
Now, imagine that you have moved to the
cs1730
directory, which of the following commands will get you back to your home directory?cd ~
cd ../../..
cd ../..
cd ../
cd /home/users/user
cd /../../
Solutions (Don’t open until completing the questions above)
Correct. This is a valid absolute path to the
cs1730
directory.Correct. Using the
~
for an alias to the home directory, this will work.Incorrect. We cannot get directly into
cs1730
from our home directory. This is an invalid relative path.Incorrect.
cs1730
is not contained within our home directory.Correct. This is a valid relative path from our home directory to
cs1730
.Incorrect. This is an invalid absolute path.
Correct. This command will always get you to your home directory since
~
is an alias for our home directory.Correct. This is a valid relative path that moves up three directories.
Incorrect. This will move us to the
cs1302-unix
directory.Incorrect. This will move us up to the
notes
directory.Correct. This is a valid absolute path to our home directory.
Incorrect. This is an invalid absolute path.