yeyo
yeyo

Reputation: 3009

how to delete 600 GBs of small files?

This was an interview question, they did not tell any information about the files, ie: extension, hidden files?, location (stored in single directory or a directory tree), so my first reaction to this question was:

rm -fr *

oh no, wait, should be:

rm -fr -- *

Then I realize that the above command would not remove hidden files successfully and quite frankly directories like . and .. might interfere, my second and final thought was a ShellScript that uses find.

find -depth -type f -delete

I'm not sure if this is the right way of doing it, I'm wondering if there is a better way of doing this task.

Upvotes: 0

Views: 301

Answers (1)

Related Questions