$
학습 Linux 안내서
ko
XP:0
퀘스트 28Drift Hunter
+250 XP

Comparing Files with diff

이 퀘스트를 위한 인터랙티브 터미널 시작→설치 불필요 • 브라우저에서 바로 실행

개념 및 개요

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.

Spot configuration drift between 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.

명령어 구문 참조

Command / SyntaxDescription
diff app_v1.conf app_v2.confCompare files line by line
diff -u app_v1.conf app_v2.confCompare files using unified diff format

검증 목표

  • ○
    Run diff on app_v1.conf and app_v2.conf
  • ○
    Run diff -u on app_v1.conf and app_v2.conf

퀘스트를 완료할 준비가 되셨나요? 28?