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
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 filesrm -r
: recursively remove subdirectoriesThe way the
rm -r
option was implemented at that time, whenrm
encountered a directory among the files it was removing, it wouldcd
(then calledchdir
) to that directory and start another instance ofrm -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.