Skip to content

Latest commit

 

History

History
67 lines (51 loc) · 1.31 KB

File metadata and controls

67 lines (51 loc) · 1.31 KB
title diff コマンドの大小記号がどっちだったかわからなくなったら見てね
emoji 🐤
type tech
topics
diff
colordiff
published true
order 136
layout article

結論

  • にある引数側の差分が <
    • colordiff の場合は 赤色
  • にある引数側の差分が >
    • colordiff の場合は 緑色
引数 記号
< 赤色
> 緑色

検証

左側 (test1.txt)

cat test1.txt
Hello world
test1 side

右側 (test2.txt)

cat test2.txt
Hello world
test2 side

diff

diff test1.txt test2.txt
2c2
< test1 side
---
> test2 side

の引数 (test1.txt) 側にだけある差分が < で表示され、 の引数 (test2.txt) 側にだけある差分が > で表示される。

colordiff

左 (<) が赤色、右 (>) が緑色で表示される。

おわり

毎回忘れるので備忘録として記録しておくことにした。