我要做的是只删除文件中包含的文件夹。
例如:
我的目标是删除文件夹1和2,并留下以下内容:
-File1
-File2
发布于 2023-06-01 15:50:24
您必须先将文件移动(或复制)到父文件夹,然后删除子文件夹。您可以在下载文件夹中使用以下命令:
mv */* . # moves all items that are in folders to the current directory
rmdir */ # removes all empty directories from the current directory在系统中的任何其他地方,只需在*之前添加完整路径,并使用完整路径而不是.,例如
mv /home/hellomrmeseeks/Downloads/*/* /home/hellomrmeseeks/Downloads/
rmdir /home/hellomrmeseeks/Downloads/*/https://askubuntu.com/questions/1470273
复制相似问题