• narshee@iusearchlinux.fyi
    link
    fedilink
    arrow-up
    11
    ·
    1 year ago

    You can do echo */ and echo /* to see how they expand. Also rm -rf / already is enough without the * as it already is recursive

    • fl42v
      link
      fedilink
      arrow-up
      15
      ·
      1 year ago

      * is there to bypass the need for --no-preserve-root

        • second@feddit.uk
          link
          fedilink
          English
          arrow-up
          7
          ·
          edit-2
          1 year ago

          Originally, rm would merrily nuke your whole filesystem if you told it to. At some point, someone thought that was a pretty stupid default behaviour, so they added that flag to change the default to not nuke your entire filesystem. However, they made the change backwards compatible in case someone still needed the old behaviour. I can imagine in a container or throwaway environment, it might be vaguely reasonable to expect to be able the blat /.

          See also:

          Unix gives you just enough rope to hang yourself – and then a couple of more feet, just to be sure.

          – Eric Allman