zl程序教程

您现在的位置是:首页 >  其他

当前栏目

[日常] Linux使用diff来比较目录

2023-02-18 15:47:06 时间

Linux diff比较两个目录的不同:

diff dir1 dir2  -urNaq

-a  --text  Treat all files as text.

-u  -U NUM  --unified[=NUM]  Output NUM (default 3) lines of unified[统一] context.

-u,-U<列数>或--unified=<列数>:以合并的方式来显示文件内容的不同;

-N  --new-file  Treat absent[缺少] files as empty.

-r  --recursive  Recursively compare any subdirectories found.

-q  --brief  Output only whether files differ.[不显示内容]

比较两个目录的不同: