# File deletion problems

Tue Apr 13 19:34:23 UTC 2010

On Tue, Apr 13, 2010 at 13:25, MirJafar Ali <mirjafarali at gmail.com> wrote:
> Hello,
>
>
> I am not quite sure if this is appropriate question to this question here.
>
> 3-4 days I wrote some program which had some problem, therefore created
> about 1 million small files in one directory. 3 days back I have the comman
> \rm -rf <Directoryname and still the code running. When I see the "top" it
> shows
> that only 1% CPU is utilized.
>
>
> I am not sure where things are going wrong. There is no other activity other
> than
> \rm -rf command. Do why does "remove" takes so much time. I am sure that
> creation didn't take that much time.

Why don't you kill the command and check in the directory... or look
in /var/log/syslog and see if there are any error messages.

or open one terminal and run this command:

#watch --inverval=1 'ls path/to/directory | wc -l'

and in another terminal:

#rm -f /path/to/directory/*

the terminal running watch will give you a running tally of how many
files are there while the other terminal is deleting files...

that's an ugly hack and could be resource intensive, but it's quick and dirty.