How can rm -rf be slower than delete in nautilus?

2

I had this very surprising situation recently, while trying to delete folders containing many files (think code repo checkout with some 10 thousands files):

  • When I tried to do this via command line as I normally would with rm -rf I waited for quite a while (say a minute?) without it finishing...

  • On the other hand, when deleting folders of the same size in nautilus file browser, the delete was instantaneous - and not only so in the GUI, but the folder was also gone in the FS, as a ls on the terminal showed me.

So how can this be? Doesn't nautilus just execute 'normal' rm? Or is it equipped with some way of dealing with large tasks in the background?

fgysin reinstate Monica

Posted 2013-10-04T08:41:23.723

Reputation: 2 228

Answers

4

Nautilus "deletes" files by moving them to the trash, and moving a file on the same filesystem is a very fast operation. You forgot to add the time taken emptying the trash into your observation.

Ignacio Vazquez-Abrams

Posted 2013-10-04T08:41:23.723

Reputation: 100 516

1That was sort of obvious, now I feel stupid. :) – fgysin reinstate Monica – 2013-10-10T13:57:15.547