Bitpath

Lesson 1 · Unit 01

Where am I

pwd, cd and ls: absolute and relative paths

12 exercisesabout 3 min

What you practise

  • pwd, ls -la, cd, absolute vs relative paths, ., .., ~, hidden files, the layout of / (/etc, /home, /var, /tmp, /usr/bin)

Try a question from this lesson

Pick one

A shell always stands in one folder. pwd prints it and cd changes it. The first pwd prints /home/ada. What does the second print?

shell
mkdir projects
pwd
cd projects
pwd

The ideas

Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.

Concept

Two kinds of path

A path that starts with / is absolute: it begins at the root of the tree and means the same thing wherever you are.

Anything else is relative: it begins in your current folder.

Three shortcuts: . is the current folder, .. is its parent, ~ is your home folder.

shell
cd /var/log   # absolute
cd ..         # up one: now in /var
cd ./log      # same as: cd log
cd ~          # home, from anywhere

Concept

One tree, from /

Linux has no drive letters. Everything hangs off one root, /, and a few folders mean the same on every machine.

Programs live in /usr/bin, system settings in /etc, logs in /var/log, each user's own files under /home, and throwaway files in /tmp.

/
├── etc/        settings
├── home/
│   └── ada/    your files (~)
├── tmp/        scratch space
├── usr/
│   └── bin/    programs
└── var/
    └── log/    logs

9 more exercises in the app

  • 3× type the answer
  • 2× multiple choice
  • 1× fill the blanks
  • 1× true or false
  • 1× match the pairs
  • 1× order the lines

Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.

One email when Bitpath is ready to try. Nothing else. Privacy