我有两个包含文件路径的文件。
档案1
/home/anybody/proj1/hello.h
/home/anybody/proj1/engine.h
/home/anybody/proj1/car.h
/home/anybody/proj1/tree.h
/home/anybody/proj1/sun.h
文件2
/home/anybody/proj2/module/include/cat.h
/home/anybody/proj2/module/include/engine.h
/home/anybody/proj2/module/include/tree.h
/home/anybody/proj2/module/include/map.h
/home/anybody/proj2/module/include/sun.h
我需要一个命令,可能使用grep,它会比较两个文件并输出两个文件的组合,但如果文件名中有重复项,请保留文件2中的文件。
预期产出:
/home/anybody/proj1/hello.h
/home/anybody/proj1/car.h
/home/anybody/proj2/module/include/cat.h
/home/anybody/proj2/module/include/engine.h
/home/anybody/proj2/module/include/tree.h
/home/anybody/proj2/module/include/map.h
/home/anybody/proj2/module/include/sun.h
这样我就可以为我的项目标签数据库生成一个包含文件的列表,但是一些文件被构建复制了,我不希望在同一个文件中有两个副本。我的数据库。