Diff

From 탱이의 잡동사니
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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