diff 出现意外结果

diff 出现意外结果

输出不是矛盾吗?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

相关内容