
我正在使用“Ubuntu Server 14.04.1 LTS”,如果 NTFS samba 共用上的檔案在 Windows 中被標記為“隱藏”,則在讀取時遇到問題。請幫助我找到需要安裝的軟體包或讀取屬性的正確命令(包括它是否被標記為隱藏在 ntfs (windows) 中)
(請注意,這與檔案名稱是否以點開頭無關。)
答案1
您可以使用smbclient
檢視共用並顯示 DOS 屬性。
smbclient //server/share
ls
答案2
您可以使用 smbclient -c 'allinfo hide.txt' 如下:
root@ip-10-0-0-191:~# smbclient -A /tmp/creds //10.0.0.58/share -c 'allinfo hide.txt'
altname: hidden.txt
create_time: Fri Jun 8 03:04:22 PM 2018 EDT
access_time: Fri Jun 8 03:04:22 PM 2018 EDT
write_time: Fri Jun 8 03:04:22 PM 2018 EDT
change_time: Fri Jul 6 10:42:49 AM 2018 EDT
attributes: HA (22)
stream: [::$DATA], 0 bytes
從上面的輸出中,檢查下面的「attributes:」行:attributes: HA (22)
//10.0.0.58/share下的hidden.txt檔案的屬性是隱藏和存檔(H-隱藏,A-存檔)
屬性值為22。https://docs.microsoft.com/en-us/windows/desktop/fileio/file-attribute-constants