Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 8 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.