Cannot delete a directory with rm -rf: Cannot remove directory not empty.

huangapple go评论70阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年4月13日 17:29:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/76003849.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定