SI Learning
0% read · Practice is tracked separately
← My learning
Version 1 · Chapter 8Reading mode

Edit a file and make a repeatable task

By the end: Save a text file confidently and explain how a small build recipe works.

The idea

Start with one editor you can exit comfortably. Keep commands and output separate in your notes. A Makefile describes targets, prerequisites, and recipes; recipes normally begin with a real tab, not spaces. Read any downloaded Makefile before running it because recipes can execute arbitrary commands.

Your command toolkit

nano

What it solves: Edit a file with visible shortcuts.

bash
nano notes.txt

Ctrl+O writes the file, Enter confirms its name, and Ctrl+X exits. The ^ symbol in nano's shortcut bar means Ctrl.

vim

What it solves: Edit using modes and repeatable actions.

bash
vim notes.txt

Press i to insert, Escape to return to normal mode, then :wq and Enter to save and quit. :q! discards unsaved changes.

make

What it solves: Run a named local recipe.

bash
make -n hello

In this course's known Makefile, -n previews the recipe. It is not a sandbox for an untrusted Makefile: expansion and recursive recipes can still execute code.

Before you move on

Try the guided lab below. Compare the result with the explanation, then record your reasoning in the workbook. A missing optional program or a restricted environment is something to explain, not a reason to change system settings blindly.

Practice with evidence

  1. Predict the result
  2. Run the guided lab
  3. Compare the output
  4. Explain your choice

A worked example

Guided lab

bash
si_lab=$(mktemp -d)
cd "$si_lab" || exit
printf '.PHONY: hello\nhello:\n\t@printf "Hello from SI\\n"\n' > Makefile
cat Makefile
make -n hello
make hello

What to expect: The preview shows the printf recipe, and the actual target prints Hello from SI. make must be installed.

Make it yours: Use nano or vim to change the greeting. Record the save/exit sequence and explain why reviewing a Makefile matters.

Read further

Apply what you learned

Your private practice

What normally begins a recipe line in a Makefile?

Answers are private. Completion requires the correct knowledge-check answer and a written response when an activity is included.

Restore a downloaded workbook

Choose a recovery file for this course and version. Review the recovered copy before saving it to your account.

Ask a question or report a problem

Describe what needs attention. Your private answer is shared only if you select the option below.

All learning paths
SI CENTRALIZATION · LEARN

Linux Command Line: from first command to confident practice

24 chapters · Your own pace

0 of 24 chapters complete
Edit a file and make a repeatable task | SI Centralization