Skip to content
Clairos Learn

Terminal basics · Lesson 11 of 34 · 7 minutes

Safe movement

Move between root, etc, and home while checking location.

Mastery 0/3Run itExplain itApply it
learner@clairosSimulated Linux lab
learner@clairos:~ $
↑ history · Tab complete · Ctrl+C cancel · Esc, Tab to leaveExit 0

Understand the pattern

Most file mistakes begin with being in the wrong directory.

cd
Change the shell working directory; .. selects the parent and ~ identifies your home.

Changing directories changes how later relative paths resolve.

pwd
Print the directory that relative paths currently resolve from.

A relative path is interpreted from the working directory, not necessarily the home folder.

Worked example and expected result
$ cd /etc
(no output; exit 0)

Exit status: 0. The command completed successfully in the training fixture.

$ pwd
/etc

Exit status: 0. The command completed successfully in the training fixture.

$ cd ~
(no output; exit 0)

Exit status: 0. The command completed successfully in the training fixture.

Try a variation

Repeat this workflow in the sandbox with a different scratch filename. Keep the system fixtures unchanged and compare the observed output with your expectation before moving on.

Explain it

In “Safe movement”, which interpretation is safe?

Apply it elsewhere

Before adapting the pwd workflow from “Safe movement” to another server, what should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Quoted pathsTry an incident drill

Anonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.

Keep learning

  1. 01Option patternsCompare short flags and long listings in a safe directory.Practice
  2. 02Quoted pathsCreate and list a path that contains a space.Practice
  3. 03Output redirectionWrite simple command output into a safe lab file.Practice