"리눅스 diff3"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
6번째 줄: 6번째 줄:


==예시==
==예시==
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# cat sample1.txt
[root@zetawiki ~]# cat sample1.txt
hello
hello
world
world
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# cat sample2.txt
[root@zetawiki ~]# cat sample2.txt
hello
hello
world!
world!
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# cat sample3.txt
[root@zetawiki ~]# cat sample3.txt
hello
hello
world
world
tiger
tiger
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# diff3 sample1.txt sample2.txt sample3.txt
[root@zetawiki ~]# diff3 sample1.txt sample2.txt sample3.txt
====
====
32번째 줄: 32번째 줄:
   world
   world
   tiger
   tiger
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# diff3 sample1.txt sample2.txt sample3.txt -A
[root@zetawiki ~]# diff3 sample1.txt sample2.txt sample3.txt -A
2a
2a
46번째 줄: 46번째 줄:
<<<<<<< sample1.txt
<<<<<<< sample1.txt
.
.
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2025년 9월 7일 (일) 18:08 판

1 개요

diff3
/usr/bin/diff3
  • 파일 3개를 비교하는 리눅스 명령어
  • 세 파일의 차이를 보여줌

2 예시

[root@zetawiki ~]# cat sample1.txt
hello
world
[root@zetawiki ~]# cat sample2.txt
hello
world!
[root@zetawiki ~]# cat sample3.txt
hello
world
tiger
[root@zetawiki ~]# diff3 sample1.txt sample2.txt sample3.txt
====
1:2c
  world
2:2c
  world!
3:2,3c
  world
  tiger
[root@zetawiki ~]# diff3 sample1.txt sample2.txt sample3.txt -A
2a
||||||| sample2.txt
world!
=======
world
tiger
>>>>>>> sample3.txt
.
1a
<<<<<<< sample1.txt
.

3 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}