사용자 도구

사이트 도구


linux:diff

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
linux:diff [2012/11/09 22:37]
kwon37xi
linux:diff [2022/12/19 16:41] (현재)
kwon37xi
줄 3: 줄 3:
   * [[http://linux.about.com/library/cmd/blcmdl1_sdiff.htm|sdiff]]   * [[http://linux.about.com/library/cmd/blcmdl1_sdiff.htm|sdiff]]
   * [[http://linux.about.com/library/cmd/blcmdl1_diff.htm|diff]] : colordiff 명령도 있음   * [[http://linux.about.com/library/cmd/blcmdl1_diff.htm|diff]] : colordiff 명령도 있음
 +  * [[https://github.com/so-fancy/diff-so-fancy?ref=stackshare|Diff So Fancy]]
  
 +===== 더 좋은 diff =====
 +  * https://github.com/so-fancy/diff-so-fancy
 +  * https://github.com/dandavison/delta
 +
 +===== 파일 내용을 비교하여 중복건은 제외하고 출력하기 =====
 +  * [[https://stackoverflow.com/questions/4366533/how-to-remove-the-lines-which-appear-on-file-b-from-another-file-a|linux - How to remove the lines which appear on file B from another file A? - Stack Overflow]]
 +  * 하나의 파일에 여러 내용이 있고, 거기서 제외시킬 내용을 한 줄마다 가진 파일이 있다고 할때, ''<origin>'', ''<lines-to-be-removed>''
 +<code sh>
 +# 정렬 된 파일일 경우
 +comm -23 <origin> <lines-to-be-removed> 
 +
 +join -v <origin> <lines-to-be-removed> 
 +
 +# 정렬 무관
 +grep -Fvxf <lines-to-be-removed> <origin>
 +
 +awk 'NR==FNR{a[$0];next} !($0 in a)' <lines-to-be-removed> <origin>
 +
 +comm -23 <(sort <origin>) <(sort <lines-to-be-removed>
 +
 +join -v 1 <(sort <origin>) <(sort <lines-to-be-removed>)
 +
 +diff <origin> <lines-to-be-removed> \
 +    --new-line-format="" --old-line-format="%L" --unchanged-line-format=""
 +</code>
 +  * [[linux:comm|comm]]
 +  * [[linux:grep|grep]]
 +  * [[linux:awk|awk]]
 +  * [[linux:join|join]]
linux/diff.1352468260.txt.gz · 마지막으로 수정됨: 2012/11/09 22:37 저자 kwon37xi