On 2018-06-10 23:14, Pádraig Brady wrote:
I was asked off list to consider adding an option to rm that could be enabled with an alias, and would protect mount points specified on the command line.
[...]
$ rm -r --preserve-root=all /dev/shm rm: skipping '/dev/shm', since it's a mount point rm: and --preserve-root=all is in effect
The command option is well-named, but consider changing "mount point" to "mount" in this diagnostic and, more importantly, any documentation which refers to this. E.g. "since a filesystem is mounted there", "since it is a filesystem root", etc. I think the "mount point" terminology is misleading because one important sense of the word is that it refers to the Unix kludge of requiring an empty directory to exist for a mount. The empty directory where one intends to mount a filesystem is the "mount point" for it. This option cannot protect directories which are mount points in that sense; only ones that are carrying mounts.