6

Why does Ubuntu, and any other unix system for that matter what you to use "remove recursively" for folders or copy recursively. I can only imagine it's a security thing but the name recursive doesn't imply such a thing.

1 Answer 1

8

It is mostly for historical reasons. The following is a slightly modified extract from an excellent article named A Brief History of the 'rm' and 'rmdir' commands.


A new version of rm, dated January 20, 1973, included these options:

  • rm -f: don't ask before removing read-only files
  • rm -r: recursively remove subdirectories

The way the rm -r option was implemented at that time, when rm encountered a directory among the files it was removing, it would cd (then called chdir) to that directory and start another instance of rm -r * to remove its contents.

A version which did the recursion within a single rm process appeared in the Seventh Edition of Unix in 1979.


More about the history of rm can be found by following the link above.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .