If you run an strace on rm you will find that it compiles a list by calling
fsstat so with very large sets of files if you catch it right away it will
be stopped before actually removing any files. Been there obviously ;)

*Jason Lindberg*
UNIX Systems Engineer
651.260.1354




On Mon, May 20, 2013 at 8:48 AM, jason reynolds <jeruvin at gmail.com> wrote:

> I'm a big fan of running a ls command in place of the rm before giving it
> the full run.
>
>
> On Monday, May 20, 2013, Michael Moore wrote:
>
>> On Mon, May 20, 2013 at 8:31 AM, gregrwm <tclug1 at whitleymott.net> wrote:
>> >> The difference I am wondering about is how the command responds to
>> ctrl-c.
>> >> For me, it looks like it deleted some directories and left others
>> completely
>> >> untouched.  The "*" glob expands to a list of directory names, so I
>> suspect
>> >> the ctrl-c breaks the command after it finishes on the current filename
>> >> argument.  Thus, I think ctrl-c might not stop "rm -rf /home" until it
>> is
>> >> done.
>> >>
>> >>
>> >> When I get commands like that which I need to terminate, I do:
>> >> ctrl-z
>> >> kill -9 %1
>> >
>> >
>> > you mean
>> > ctrl-z
>> > kill -9 %
>> >
>> > %1 may or may not be the right job
>>
>> Yes, good point. % is better.
>>
>> I don't usually background jobs so %1 is usually the only job I've got
>> running in the background. I haven't killed anything I didn't mean to
>> yet, but I'm sure it would've happened eventually.
>>
>> --
>> Michael Moore
>> _______________________________________________
>> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
>> tclug-list at mn-linux.org
>> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
>>
>
>
> --
> jason
>
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20130520/44c0e235/attachment-0001.html>