develog

[bash] diff 본문

카테고리 없음

[bash] diff

냐옴 2022. 4. 29. 10:21

 

# -r 서브 디렉토리까지 비교
# -q 파일명만 출력하고 내용은 출력하지 않음
# -s 동일한 파일도 결과로 출력
diff -rq dir01 dir02

# --exclude
diff -rq \
    --exclude '.DS_Store' \
    --exclude '.git' \
    --exclude 'build' \
    --exclude 'node_modules' \
    --exclude '*js_del' \
    node-backend1 node-backend2

 

$ diff --help

-r  --recursive  Recursively compare any subdirectories found.
-q  --brief  Output only whether files differ.

-w  --ignore-all-space  Ignore all white space.
-B  --ignore-blank-lines  Ignore changes whose lines are all blank.
-i  --ignore-case  Ignore case differences in file contents.
-s  --report-identical-files  Report when two files are the same.
Comments