在Linux错误中删除文件夹及其子文件夹

时间:2015-07-23 07:38:23

标签: linux

我的一个朋友在我们的PC中创建了一个排序shell脚本(Ubuntu是操作系统)。 但是这个代码会出错,程序会在文件夹中不断创建子文件夹。

以下是目录的示例:

/CC02/D_C01/6001/CC02/D_C02/6001/CC02/D_C04/6001/CC02/D_C04/6001/CC02/D_C04/6001/CC02/D_C05/6001/CC02/D_C05/6001/CC02/D_C05/6001/CC02/D_C01/6002/CC02/D_C04/6002/CC02/D_C04/6002/CC02/D_C04/6002/CC02/D_C05/6002/CC02/D_C05/6002/CC02/D_C05/6002/CC02/D_C01/6003/CC02/D_C02/6003/CC02/D_C04/6003/CC02/D_C04/6003/CC02/D_C04/6003/CC02/D_C05/6003/CC02/D_C05/6003/CC02/D_C05/6003/CC02/D_C01/6004/CC02/D_C02/6004/CC02/D_C04/6004/CC02/D_C04/6004/CC02/D_C04/6004/CC02/D_C05/6004/CC02/D_C05/6004/CC02/D_C05/6004/CC02/D_C01/6005/CC02/D_C04/6005/CC02/D_C04/6005/CC02/D_C04/6005/CC02/D_C05/6005/CC02/D_C05/6005/CC02/D_C05/6005/CC02/D_C01/6006/CC02/D_C02/6006/CC02/D_C04/6006/CC02/D_C04/6006/CC02/D_C04/6006/CC02/D_C05/6006/CC02/D_C05/60

我取消了脚本并尝试使用以下代码删除从顶部开始的文件夹:

rm -f *

但是我收到以下错误:

rm: cannot determine if this is an ancestor of the current working directory

0 个答案:

没有答案