更新时间:2023-12-04 21:28:46
如果使用diff -u,它将生成统一的diff,其行之前带有 + 和-。如果通过grep传递输出(仅获取 + 或-),然后传递给wc,则获取 + 的计数和分别是-。
If you use diff -u it will generate a unified diff that has lines preceded with + and -. If you pipe that output through grep (to get only the + or -) and then to wc you get the counts for the + es and the - es respectively.