예상치 못한 차이 결과

예상치 못한 차이 결과

출력이 모순되지 않나요? diff파일이 다음 위치 중 하나에만 있음을 보고합니다. 그런데 확인해 보니 ls파일이 있었어요. 이유는 무엇입니까? 파일 이름에 ASCII가 아닌 문자가 포함되어 있기 때문입니까? (영형)

% sudo diff -x .DS_Store /Volumes/Seagate\ Backup\ Plus\ Drive/junk /Users/niklasrosen/backup/seagateBackupPlus/junk | grep -v __MACOSX | grep -v niklasrosen 
    Password:
    Only in /Volumes/Seagate Backup Plus Drive/junk: slutlön2020.txt
% ls -al /Volumes/Seagate\ Backup\ Plus\ Drive/junk/slutlön2020.txt 
    -rwxr-xr-x  1 niklasrosen  staff  947 Aug 12  2020 /Volumes/Seagate Backup Plus Drive/junk/slutlön2020.txt
% ls -al /Users/niklasrosen/backup/seagateBackupPlus/junk/slutlön2020.txt 
    -rwxr-xr-x  1 niklasrosen  staff  947 Mar 14 03:36 /Users/niklasrosen/backup/seagateBackupPlus/junk/slutlön2020.txt

추가 조사를 통해 다음과 같은 내용을 설명해야 한다는 사실이 밝혀졌습니다.

% mkdir diffcheck
% cp /Volumes/Seagate\ Backup\ Plus\ Drive/junk/slutlön2020.txt diffcheck 
% ls -al /Volumes/Seagate\ Backup\ Plus\ Drive/junk/slutlön2020.txt 
        -rwxr-xr-x  1 niklasrosen  staff  947 Aug 12  2020 /Volumes/Seagate Backup Plus Drive/junk/slutlön2020.txt
% ls -al diffcheck 
        total 8
        drwxr-xr-x   3 niklasrosen  staff    96 Mar 14 10:27 .
        drwxr-xr-x+ 80 niklasrosen  staff  2560 Mar 14 10:27 ..
        -rwxr-xr-x   1 niklasrosen  staff   947 Mar 14 10:27 slutlön2020.txt
% diff /Volumes/Seagate\ Backup\ Plus\ Drive/junk/ diffcheck|grep ö      
        Only in diffcheck: slutlön2020.txt
% ls -al /Volumes/Seagate\ Backup\ Plus\ Drive/junk/slutlön2020.txt 
        -rwxr-xr-x  1 niklasrosen  staff  947 Aug 12  2020 /Volumes/Seagate Backup Plus Drive/junk/slutlön2020.txt

관련 정보