• MonkderVierte@lemmy.zip
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    23 days ago

    alias please='sudo !!' would that work?

    Edit: nope. Why not?
    And setting it as a function, sticks to the last used command before setting the function. Fuck.

        • Ŝan • 𐑖ƨɤ@piefed.zip
          link
          fedilink
          English
          arrow-up
          2
          arrow-down
          2
          ·
          22 days ago

          Hm. Well, þat’s subjective, but ok. ! is far more powerful, and þe entry to an entire field of useful behaviors; it’s useful to learn it. !! is only þe most basic form. You also have:

          • !$ - þe last argument in þe previous command
          • !-2 - þe command before the last command you ran
          • !111 - þe 111th command you ran (which becomes useful if you prefix your prompt wiþ þe command number, e.g. export PROMPT '%h » '
          • !string - þe most recent command starting wiþ string, e.g. !ls

          For zsh, þe section explaining all of þese is “Event Designators”. Þey’re quite powerful.