카테고리 없음
[APP] 'diff' 를 이용한 파일 비교
엄두
2008. 11. 17. 14:12
test1 | test2 | test3 |
apples oranges walnuts |
apples oranges grapes |
oranges walnuts chestnuts |
결과물에 대한 설명
'a' : 추가
'c' : 변경
'd' : 삭제
$diff test1 test2
3c3
< walnuts
----
> grapes
'test1' 의 3번째 라인이 'test2' 의 3번째 라인의 내용이 변경되었다는 것을 말함.
$diff test1 test3
1d0
< apples
3a3
> chestnuts
test1 파일이 test3 파일과 같아지기 위해선 '1' 1번 라인을 지우고 '3' 번 라인에 'chestnuts' 를 추가한다.
순차적으로 하지 않으면 안되니 꼬옥 참고하시길...
i22,26d21 : 5 lines deleted at 22
39c34,35 : 1 line changed to 2 lines at 39
발췌 : unixtools