Missão 28Drift Hunter
+250 XP
Comparing Files with diff
Iniciar terminal interativo para esta missão→Sem instalação necessária • Executado no navegador
Conceito e visão geral
In production environments, servers fail when configuration files silently diverge over time—a problem called "configuration drift". The diff utility compares two text files line by line and highlights every difference:
- Standard format: diff file1.conf file2.conf uses < to indicate lines from the first file and > for lines in the second file.
- Unified format: diff -u file1.conf file2.conf produces unified diff output (- for removed lines, + for added lines), which is the standard format used by Git patches and modern pull requests.
Instruções da missão
Spot configuration drift between
1. Run
2. Run
app_v1.conf and app_v2.conf in /home/learner:1. Run
diff app_v1.conf app_v2.conf to view standard line differences.2. Run
diff -u app_v1.conf app_v2.conf to view the unified diff patch format.Referência de sintaxe de comandos
| Command / Syntax | Description |
|---|---|
diff app_v1.conf app_v2.conf | Compare files line by line |
diff -u app_v1.conf app_v2.conf | Compare files using unified diff format |
Objetivos de verificação
- ○Run diff on app_v1.conf and app_v2.conf
- ○Run diff -u on app_v1.conf and app_v2.conf