Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Linux 刪除亂碼檔名檔案:使用 inode 編號強制移除

編輯:Linux 教學

FTP 或檔案系統編碼不一致導致出現亂碼檔名,無法用一般 rm 刪除(提示 No such file or directory)。解法:透過 inode 編號直接操作。

操作步驟

  1. 進入目錄:cd /path/to/dir
  2. 列出 inode:ls -i
    輸出範例:295086 亂碼檔案.doc
  3. 依 inode 刪除:find . -inum 295086 -delete

參數說明

  • -inum:指定 inode 編號查詢。
  • -delete:直接刪除找到的檔案/空目錄。

注意事項

  • 僅適用於檔案或空目錄,非空目錄需先清空內容。
  • 若 find 不支援 -delete,可改用 find . -inum 295086 -exec rm -f {} \;。

透過 inode 繞過檔名編碼問題,精準刪除頑固檔案。

Copyright © Windows教程網 All Rights Reserved