Can't remove a directory in Unix

前端 未结 6 735
野性不改
野性不改 2020-12-28 14:27

I\'ve got a seemingly un-deletable directory in Unix that contains some hidden files with names that start with .panfs. I\'m unable to delete it using either o

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-28 15:13

    I recently could not delete a folder created by a crazy going backup job on a QNAP. It created sub/sub/sub/sub/sub/.... folders until it couldn't.

    rm -rf sub
    rm -rf sub/sub/sub/sub/sub/sub/sub
    

    all rm commands failed with: can't remove 'sub/sub/sub/sub': Directory not empty

    I tied to rename some folder to make the path shorter, but it didn't help. But after moving one of the subfolders, I was able to delete all.

    mv backup/backup deleteme
    rm -rf deleteme
    rm -rf folder/backup
    

提交回复
热议问题