• yeehaw@lemmy.ca
    link
    fedilink
    arrow-up
    9
    ·
    1 day ago

    !! Just puts in your last typed command. So if you typed rm -rf /etc, you wouldn’t have permission. But if you typed in sudo !! Right after, then you’re really fucked.

    • TrickDacy@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      1 day ago

      Ah I wasn’t clear – those, I knew. It’s alt+S I don’t know. I’m at my machine now and it doesn’t seem to do anything on Pop_OS.

      • clif@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        1 day ago

        Seem to be a fish shell thing.

        I tested on my good ole trusty bash and got nothing so I went searching.

        EDIT: Clarification : alt+s seems to be a fish shell thing.

    • softotteep@pawb.social
      link
      fedilink
      English
      arrow-up
      1
      ·
      22 hours ago

      But if you typed in sudo !! Right after, then you’re really fucked.

      Not if you don’t type your password.

      • ClownStatue@piefed.social
        link
        fedilink
        English
        arrow-up
        3
        ·
        18 hours ago

        Adding to this, if you notice numbers next to your previous commands when you run history, you can do !<number> and it will rerun that command. Probably the second cool shell trick I learned back in the olden days or yore (mid-90s?) after ⬆️

      • yeehaw@lemmy.ca
        link
        fedilink
        arrow-up
        2
        ·
        20 hours ago

        I assume if you are silly enough to type in rm -rf /etc, then you are silly enough to type in your password 😅