对比两个文件有什么不同的时候,使用diff和vimdiff命令进行比较
diff命令:
方法一:
[[email protected] ~]# echo 123 > a.txt
[[email protected] ~]# echo 234 > b.txt
[[email protected] ~]# diff a.txt b.txt
1c1
< 123
---
> 234
方法二:vimdiff a.txt b.txt
时间: 2024-10-25 05:26:56
对比两个文件有什么不同的时候,使用diff和vimdiff命令进行比较
diff命令:
方法一:
[[email protected] ~]# echo 123 > a.txt
[[email protected] ~]# echo 234 > b.txt
[[email protected] ~]# diff a.txt b.txt
1c1
< 123
---
> 234
方法二:vimdiff a.txt b.txt