0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

diff コマンドの大小記号がどっちだったかわからなくなったら見てね

Posted at

結論

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

検証

左側 (test1.txt)

Shell
cat test1.txt
Hello world
test1 side

右側 (test2.txt)

Shell
cat test2.txt
Hello world
test2 side

diff

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

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

colordiff

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

おわり

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

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?