Absolute vs Relative

Linux lab Beginner 6 tasks 10 points

Back on the island. This time, practise moving with different kinds of paths: absolute, relative, .., ~ and cd -.

How it works: the terminal below is a real Linux machine running in your browser. Click it and type. Tasks tick themselves off as you complete them; questions are answered in the box under each task. Press Reset any time for a fresh machine. Your password on this machine (for sudo) is student.

student@vulntech:~ Starting…
Getting your Linux machine ready…
The first start downloads about 20 MB. After that your browser keeps it, and labs start in a moment.

Hints

Draw the tree on paper if it helps: island contains beach, jungle and cave; cave contains lake and tunnel.

Solution explanation

An absolute path works from anywhere. From lake, .. is cave, so ../tunnel/chamber leads to the chamber. cd - goes back to the lake. From jungle, ../beach goes up to island and into beach. ~/island/beach works wherever you are.

Show solution
cd /home/student/island/cave/lake
cd ../tunnel/chamber
cd -
cd /
ls ~/island/beach
HOME LEARN COMMUNITY DASHBOARD