Skip to content
Clairos Learn

Nano and editing · Lesson 25 of 27 · 8 minutes

Nano config-copy edit

Edit a disposable config copy and compare it with the original.

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

Editing a copy instead of a live configuration helps operators explain what they know before they change anything.

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.

nano
Edit a virtual text file using the browser editor and explicitly save it.

Opening the editor does not complete a write task. Save and verify the contents.

grep
Select input lines that match a pattern; -i ignores case, -n adds line numbers, and -v inverts selection.

No matches is exit status 1, which is different from a malformed invocation.

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 data/config-a.conf lab/learn-copy.conf
(no output; exit 0)

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

$ nano lab/learn-copy.conf
Opening simulated nano for /home/learner/lab/learn-copy.conf. Save or cancel in the browser.

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

$ Save the editor buffer
server_name learn.clairos.ai;
listen 8443 ssl;
root /srv/www;

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

$ grep 8443 lab/learn-copy.conf
listen 8443 ssl;

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

$ diff data/config-a.conf lab/learn-copy.conf
--- /home/learner/data/config-a.conf
+++ /home/learner/lab/learn-copy.conf
-listen 443 ssl;
+listen 8443 ssl;

Exit status: 1. This nonzero result is an expected part of this exercise.

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-copy edit”, which interpretation is safe?

Apply it elsewhere

Before adapting the nano workflow from “Nano config-copy edit” to another server, what should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Nano recovery noteTry 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 search workflowCreate a structured note and verify a marker after saving.Practice
  2. 02Nano recovery noteWrite a rollback-oriented note and verify every required field.Practice
  3. 03Nano editing bridgeCheckpoint search, save, verification, and recovery-note habits.Practice