Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleting directories using single liner command [closed]

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>

Can I delete edi and edw using a single command?

like image 881
AruM Avatar asked Dec 28 '11 11:12

AruM


1 Answers

rm -r edi edw

rm can take an arbitrary number of arguments, and the -r flag makes it delete directories recursively. Refer to man rm for more details.

Reading manual pages are the best way to get information for your questions.

like image 173
thiton Avatar answered Sep 22 '22 14:09

thiton