使用单个线性命令删除目录 [英] Deleting directories using single liner command

查看:91
本文介绍了使用单个线性命令删除目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用单个命令删除多个目录?是否可以在一个衬管中进行?如果是,请对此提供帮助.

How to remove more than one directory using single command? Is it possible to do it in one liner? If yes, Please help on this.

/osmf/mgmt/scheduler>ls -lrt
total 22
drwx------   2 root     root     12288 Mar 26  2009 lost+found
drwxr-xr-x   4 ctmagent controlm  1024 May 24  2010 ctmagent
drwxrwxrwx   3 edwprod  edw       1024 Dec  1 09:53 edi
drwxrwxrwx 120 edwprod  edw       5120 Dec 27 09:37 edw
/osmf/mgmt/scheduler>

我可以使用单个命令删除ediedw吗?

Can I delete edi and edw using a single command?

推荐答案

rm -r edi edw

rm可以接受任意数量的参数,并且-r标志使其可以递归删除目录.有关更多详细信息,请参见man rm.而且,顺便说一句,阅读它完全可以避免这个问题.

rm can take an arbitrary number of arguments, and the -r flag makes it delete directories recursively. Refer to man rm for more details. And, BTW, read it, it would have avoided this question altogether.

这篇关于使用单个线性命令删除目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆