% cat test1.txt # text1.txtの中身を見る this is test file Hello Japan! % cat test2.txt # text2.txtの中身を見る this is test file Hello World! % diff -urN test1.txt test2.txt > test.patch # パッチファイルを作る # text1.txtをtext2 に # するパッチ % cat test.patch # パッチファイルを見る --- test1.txt 2002-12-18 16:12:31.000000000 +0900 +++ test2.txt 2002-12-18 16:12:22.000000000 +0900 @@ -1,2 +1,2 @@ this is test file -Hello Japan! +Hello World! % patch < test.patch # パッチを当てる patching file `test1.txt' % cat test1.txt # test1.txtの中身を見る this is test file Hello World!