• JasonDJ@lemmy.zip
    link
    fedilink
    arrow-up
    54
    ·
    edit-2
    1 day ago

    Don’t forget the dot files and directories. Use sudo in case of trouble…sudo rm -rf .*

    (Don’t actually do this, because some shells will take that to include . and .. recursively)

    • Scafir@discuss.tchncs.de
      link
      fedilink
      arrow-up
      37
      ·
      1 day ago

      Oh god, I never considered that .* could theoretically match ... Thanks fish for not doing that, more than likely saved my unknowing ass a couple of times

      • WhyJiffie@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        6
        ·
        23 hours ago

        Because you don’t always want to delete the directory itself, to then recreate it and set the ownerships and permissions again

            • z3rOR0ne@lemmy.ml
              link
              fedilink
              arrow-up
              1
              ·
              20 hours ago

              Fair enough. Why not tack on rm ./.* as well to that list? Lol. Sorry, I’m truly just curious and not trying to be a smart alec.

              • WhyJiffie@sh.itjust.works
                link
                fedilink
                English
                arrow-up
                7
                ·
                18 hours ago

                with that we arrive at the original problem: depending on your shell and its configuration, .. could be part of the results of the glob expansion. so at that point why bother stepping one dir level up