Unix C++
Would you like to react to this message? Create an account in a few clicks or log in to continue.

to delete empty directory!!

3 posters

Go down

to delete empty directory!! Empty to delete empty directory!!

Post by Abhiramy Tue Mar 02, 2010 5:59 pm

what is the command to delete an empty directory???wen i searched in the net,got the ans as the following code

find . -type d -empty | xargs rmdir -

but dis dint work for me!!!can anyone check dis out and explain if it worked???

Abhiramy

Posts : 9
Points : 21
Join date : 2010-02-26

Back to top Go down

to delete empty directory!! Empty Re: to delete empty directory!!

Post by mightyganesh Tue Mar 02, 2010 6:04 pm

i just tried rmdir command and it worked! i did not understand why that command did not workout for u?
rmdir <dir name>
mightyganesh
mightyganesh

Posts : 53
Points : 92
Join date : 2010-02-26
Age : 35

http://ganeshguna.blogspot.com

Back to top Go down

to delete empty directory!! Empty Re: to delete empty directory!!

Post by Abhiramy Tue Mar 02, 2010 6:30 pm

now i tried,,it worked!!!!hav any idea wat dat alternative code mean,,i mean its expln???

Abhiramy

Posts : 9
Points : 21
Join date : 2010-02-26

Back to top Go down

to delete empty directory!! Empty Re: to delete empty directory!!

Post by rohit_1000r Tue Mar 09, 2010 10:39 am

Abhiramy
the alternative command which has been specified by you does the task of searching all the empty directory in the current context and then removes it using rmdir xargs.as in
Code:
find . -type d -empty | xargs rmdir -

rohit_1000r

Posts : 4
Points : 4
Join date : 2010-03-09

Back to top Go down

to delete empty directory!! Empty Re: to delete empty directory!!

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum