Submit #2546

Add an option to rm to prevent recursive rm crossing mount points

Added by jorisgio about 1 year ago. Updated about 1 year ago.

Status:ClosedStart date:04/13/2013
Priority:NormalDue date:
Assignee:swildner% Done:

0%

Category:-
Target version:-

Description

With null mounts, rm -r in root can be dangerous. GNU rm as an option for that :

--one-file-system
when removing a hierarchy recursively, skip
any directory that is on a file system differ‐
ent from that of the corresponding command
line argument

Here is an easy patch to add a similar option to rm.

rm.patch Magnifier (1.51 KB) jorisgio, 04/13/2013 07:13 AM

History

#1 Updated by vsrinivas about 1 year ago

Looks good.

The same logic is already present in du, for example, so it's nice to have it be in all of the base utilities.

#2 Updated by swildner about 1 year ago

  • Assignee set to swildner

grab

#3 Updated by swildner about 1 year ago

Pushed, thanks!

#4 Updated by swildner about 1 year ago

  • Status changed from New to Closed

Also available in: Atom PDF