Noice (thelemmy.club)
submitted 3 months ago by to c/linuxmemes@lemmy.world
 
you are viewing a single comment's thread
view the rest of the comments
[–] 144 points 3 months ago* (30 children)

You can also just do a sudo !! the !! is a shorthand for whatever you tried to run previously.

  • source
  • hideshow 30 child comments
  • [–] 27 points 3 months ago (13 children)

    Not all shells support that.

    I use fish btw.

  • source
  • parent
  • hideshow 13 child comments
  • [–] 7 points 3 months ago (2 children)

    I don't even know what I use anymore. My distro seems to keep changing it when I reinstall.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 3 months ago (7 children)

    Holy shit I wish fish supported it. I just press up arrow then hold left arrow and manually type sudo. It fucking sucks

  • source
  • parent
  • hideshow 7 child comments
  • [–] 2 points 3 months ago

    I've used it for so many years that it's not an issue anymore. I remember using !! a lot but it was literally just for sudo. Now i either write what I need and do up or write what I need and then press alt+s, which seems even more intuitive now.

  • source
  • parent
  • [–] 4 points 3 months ago* (4 children)

    wish i could alias that

    alias ffs="sudo !!"

  • source
  • parent
  • hideshow 4 child comments
  • [–] [S] -1 points 3 months ago (6 children)
  • [–] 3 points 3 months ago (5 children)

    What shell are you using? In both bash and zsh, !! is a substitute for a previous command

  • source
  • parent
  • hideshow 5 child comments
  • [–] [S] 0 points 3 months ago (4 children)
  • [–] 2 points 3 months ago (3 children)

    Oof. Posix non-compliant stuff always gives me the ick.
    I highly recommend switching to zsh, it can do the same stuff and more, and it is actually a proper terminal. Switching scripts might be a bit complicated if you're deep into it, but it's worth it

  • source
  • parent
  • hideshow 3 child comments
  • [–] [S] 0 points 3 months ago (2 children)

    All I do in terminal is type, I don't know scripting. But I heard a lot of things about zsh.

  • source
  • parent
  • hideshow 2 child comments