diffコマンドでホワイトスペース(空白)を無視して比較する方法
diffコマンドでホワイトスペース(空白)を無視して比較するには-wオプションを指定します。
オプションの説明
-w, --ignore-all-space ignore all white space
-wオプションを指定した場合(行末の空白を無視するため差分なし)
$ diff -w test1.txt test2.txt
-wオプションを指定しない場合(行末の空白を差分として表示)
$ diff test1.txt test2.txt 2c2 < banana --- > banana 4c4 < lemon --- > lemon