Noice (thelemmy.club)
submitted 3 months ago by to c/linuxmemes@lemmy.world
 

top 50 comments

sorted by: hot top controversial new old
[–] 149 points 3 months ago (19 children)
  • [–] 33 points 3 months ago (8 children)

    Always amused me that sudo !! is actually more keypresses (at least on keyboards where typing ! requires holding Shift).

  • source
  • parent
  • hideshow 8 child comments
  • [–] 62 points 3 months ago* (4 children)

    You just blew my mind. sudo [space] [shift] !! [enter] (4+1+1+1+1+1) is one keypress longer than ↑ + home + sudo + space + enter (1+1+4+1+1). In your face, universe.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 16 points 3 months ago

    If you have an actual home key. If it's ctrl+a or (IIRC, AFK) ctrl+← then we're even.

    And if we track hand movements then pressing ! twice may be faster than moving to another key.

    But yeah, it's not at all clear that sudo !! is faster like you'd expect it to be.

  • source
  • parent
  • [–] 6 points 3 months ago (2 children)

    Actually, after kinematic analysis of the required fingertip trajectories upheaves both of these arguments. If you calculate the aggregate spatial displacement across a standard 2D Euclidean plane for both input strings, the former macro sequence yields a significantly lower metric footprint than the latter.

    For the sake of empirical demonstration, we can map this across a standard ANSI 100% layout using a normalized key pitch constraint where 1 U = 19.05 mm. By establishing a Home Row Idle-State Matrix as our behavioral anchor and tracking independent multi-finger vectors using the standard Pythagorean metric tensorβ€”calculating the straight-line distance d = sqrt( delta_x^2 + delta_y^2 ) between consecutive keystroke coordinatesβ€”we arrive at the following quantitative breakdown:

    Macro Sequence 1: sudo [shift] !! [enter]

    • Single-Handed Vector String: 40.878 U
      • Net Linear Displacement: 778.7 mm
    • Dual-Handed Touch-Typing Matrix: 8.424 U
      • Net Linear Displacement: 160.5 mm

    Macro Sequence 2: [up] [home] sudo [space] [enter]

    • Single-Handed Vector String: 40.989 U
      • Net Linear Displacement: 780.8 mm
    • Dual-Handed Touch-Typing Matrix: 21.728 U
      • Net Linear Displacement: 413.9 mm

    tl;dr

    Fewer keystrokes != less work. Even though typing !! looks like more work, it isn't because your finger travel distance is significantly shorter when executing those keys using two-handed touch typing on a standard ANSI QWERTY keyboard.

  • source
  • parent
  • hideshow 2 child comments
  • load more comments (2 replies)
  • load more comments (3 replies)
    [–] 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
  • load more comments (8 replies)
  • load more comments (12 replies)
    [–] 74 points 3 months ago (3 children)
  • [–] 21 points 3 months ago (1 child)

    Top text should maybe say copying by, rather than copying then? Since sudo !! will automatically copy the previous command with sudo in front of it, so there's no manual copying involved

  • source
  • hideshow 1 child comment
  • [–] 17 points 3 months ago (2 children)

    I know alt +. inserts the last argument of previous commands. There must be a good list of alt commands somewhere because they're pretty damn useful.

  • source
  • hideshow 2 child comments
  • load more comments (1 reply)
    [–] 15 points 3 months ago (1 child)

    I used to have an alias 'please' for that.

  • source
  • hideshow 1 child comment
  • load more comments (1 reply)
    [–] 15 points 3 months ago (4 children)

    Wait… YOU CAN DO THAT?!

  • source
  • hideshow 4 child comments
  • [–] 12 points 3 months ago (1 child)

    Or press Ctrl-S and take a nice walk outside

  • source
  • hideshow 1 child comment
  • load more comments (1 reply)
    [–] 11 points 3 months ago (3 children)
    load more comments (3 replies)
    [–] 9 points 3 months ago (10 children)

    On my Terminal that just makes it so I can't type anymore, I feel like I'm doing something wrong...

    My solution to the problem is CTRL+U, type sudo, CTRL+Y.

  • source
  • hideshow 10 child comments
  • [–] 15 points 3 months ago (6 children)

    If you hit ctrl-s, ctrl-q will unfreeze

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

    Interesting, why is that? Like what feature is that?

  • source
  • parent
  • hideshow 4 child comments
  • load more comments (1 reply)
  • load more comments (1 reply)
  • [–] 7 points 3 months ago* (10 children)

    Cannot find any reference online. What is this supposed to do? Not at a PC right now.

  • source
  • hideshow 10 child comments
  • [–] 9 points 3 months ago (8 children)

    !! 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.

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

    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.

  • source
  • parent
  • hideshow 2 child comments
  • load more comments (1 reply)
  • load more comments (5 replies)
  • load more comments (1 reply)
    [–] 5 points 3 months ago* (1 child)

    <Esc> k I sudo <Space> <Enter>

  • source
  • hideshow 1 child comment
  • load more comments (1 reply)
    load more comments
    view more: next β€Ί