英文:
Cannot delete a directory with rm -rf: Cannot remove directory not empty
问题
我正在尝试删除一些文件,但我认为它们已损坏。当我运行以下命令时:
rm prog/*
我收到以下错误信息:
rm: cannot remove 'prog/20230412_00_000_prog_regular_grid_classic.nc': No such file or directory
rm: cannot remove 'prog/20230412_00_001_prog_regular_grid_classic.nc': No such file or directory
rm: cannot remove 'prog/20230412_00_002_prog_regular_grid_classic.nc': No such file or directory
如果我尝试删除整个目录:
rm -rf prog/
我会收到以下错误:
rm: cannot remove 'prog/': Directory not empty
我找不到在线示例,其中 rm -rf dir/
不允许删除目录。如何修复这个问题?
英文:
I am trying to delete some files but I think they are corrupted. When I run the command:
rm prog/*
I get the errors:
rm: cannot remove 'prog/20230412_00_000_prog_regular_grid_classic.nc': No such file or directory
rm: cannot remove 'prog/20230412_00_001_prog_regular_grid_classic.nc': No such file or directory
rm: cannot remove 'prog/20230412_00_002_prog_regular_grid_classic.nc': No such file or directory
And if I try and delete the whole directory:
rm -rf prog/
I get the error
rm: cannot remove 'prog/': Directory not empty
I cant find an example online where rm -rf dir/
doesnt allow you to delete a directory.
How do I fix this?
答案1
得分: 1
A process had a handle on those files. I stopped the process and the files were removed.
英文:
A process had a handle on those files. I stopped the process and the files were removed.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论