Diff

From 탱이의 잡동사니
Jump to navigation Jump to search

Overview

Linux diff 명령어 내용 정리

Options

-u, -U NUM, --unified[=NUM]

지정된 NUM(default 3) 라인크기의 unified text 형태의 diff 를 만든다.

Example

$ diff -u external/Makefile internal/Makefile 
--- external/Makefile	2016-08-15 09:47:10.516758058 +0200
+++ internal/Makefile	2016-08-15 11:31:23.491594343 +0200
@@ -18,10 +18,39 @@
 DDIR=test-doc
 

+PDFDIR=
+ifeq ($(BUILD_PDF),1)
+PDFDIR=$(DDIR)/*.pdf
+endif
+

patch file 만들기

$ diff -Naur <org_file> <changed_file> > simple.patch