How do you diff a directory for only files of a specific type?

前端 未结 9 1483
囚心锁ツ
囚心锁ツ 2021-01-31 13:15

I have a question about the diff command if I want a recursive directory diff but only for a specific file type, how to do that?

I tried using the exclude option but can

9条回答
  •  太阳男子
    2021-01-31 13:40

    If you want to differ sources and keep it simple:

    diff -rqx "*.a" -x "*.o" -x "*.d" ./PATH1 ./PATH2 | grep "\.cpp " | grep "^Files"
    

    Remove the last grep if you want to get the files which exist in only one of the paths.

提交回复
热议问题