Skip to content
Clairos Learn

Nano and editing · Lesson 10 of 27 · 9 minutes

Nano config backup

Back up a config copy before editing it.

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

Diffing against a backup shows exactly what changed.

cp
Copy a file to a new location, leaving the original in place.

Confirm the destination before replacing a file. This lab supports file copies, not every cp option.

diff
Compare two text files; a difference is a meaningful nonzero status, not necessarily an execution error.

Status 1 means differences for diff; shell status must be interpreted in command context.

Worked example and expected result
$ cp /etc/nginx/sites-available/learn.conf lab/learn.conf
(no output; exit 0)

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

$ cp lab/learn.conf lab/learn.conf.bak
(no output; exit 0)

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

$ diff lab/learn.conf lab/learn.conf.bak
(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 “Nano config backup”, which interpretation is safe?

Apply it elsewhere

Before adapting the cp workflow from “Nano config backup” to another server, what should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Nano service notesTry 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. 01Nano replace reviewStart with redirected text, then review it in nano.Practice
  2. 02Nano service notesWrite service review notes and compare them with service status.Practice
  3. 03Nano incident timelineWrite a timeline and compare it with SSH journal entries.Practice