• @[email protected]
    link
    fedilink
    159 months ago

    CTR + u will delete the whole command. I use that a lot so I don’t have to backspace. It’s saved me a ton of time

    • @[email protected]
      link
      fedilink
      29 months ago

      omz reload

      not going to say zsh is better than bash or fish, but oh-my-zsh does make it more attractive for some use-cases

        • @[email protected]
          link
          fedilink
          1
          edit-2
          9 months ago

          I’ll have to give starship a try, seems like a cool way to handle customizing the prompt

          as to the “omz is bloat and slows down your shell”:

          1. How slow? Because I’ve never noticed. Are we talking about waiting for 15 seconds when I should only have to wait for 1, or are we talking theory and the difference between 0.5 vs 0.08 seconds in benchmarks?

          Because I’ve never been inconvenienced by the speed of my shell nor terminal emulator, despite having tried all kinds of setups. Turns out that “blazing fast” gpu accelerated terminal really didn’t make much of a difference on human timescales. Now I’m at the point where I appreciate the features over the performance.

          1. In reply to Brody’s point, I’m inclined to say “yes, and…?”

          OMZ automates a lot. Sure, I could follow his way of manulaly sourcing dozens of individual shellscripts and making my own aliases and have a zshrc 1200 lines long… Or I could just let omz handle it.

          Yes it’s mostly just a plugin manager, and…? Yes it automates a process I could do manually, and… ? Yes, it uses bindings that I didn’t personally write, and… ?

          Fuck off with the clickbait “You’re living your life wrong, do this lifehack instead!!!” (and the lifehack is to reinvent the wheel) bullshit

          Here’s a fun real lifehack: try things out for yourself, don’t just listen to and parrot other people’s opinions, don’t be afraid to go against the grain. Way more fun and fulfilling that way!

          • @[email protected]
            link
            fedilink
            19 months ago

            How slow, because I neved noticed

            Trust me, it’s noticeable. Or at least it was for me. Numbers wise, it doesn’t sound like much, but the difference between 0.05s and 0.5s (which are roughly the times I was experiencing) is very noticeable, at least for me. One is done before you’ve even fully lifted the finger off the key, while with the other you’re preparing to press (or maybe you’re already pressing pressing) the next key, by the time you see a reaction.

            Your mileage may vary.

  • Caveman
    link
    fedilink
    79 months ago

    g-push which is alias for

    git push origin `git branch --show`
    

    Which I’m writing on my phone without testing or looking

    • JackbyDev
      link
      fedilink
      English
      29 months ago

      git config --global alias.pusho 'push --set-upstream origin HEAD'

      You’re welcome.

      • Caveman
        link
        fedilink
        19 months ago

        So that’s making git push always push to the current branch?

        • JackbyDev
          link
          fedilink
          English
          1
          edit-2
          9 months ago

          When you’re pushing a new branch you’ve never pushed before you need the -u command. That’s what this alias is for.

          As long as the config’s push.default isn’t matching, git push without arguments will only push the current branch.

    • Cruxil 🇦🇺
      link
      fedilink
      English
      29 months ago

      git push origin HEAD is a slightly shorter way of doing the same thing, even though you have an alias anyway lol

  • @[email protected]
    link
    fedilink
    7
    edit-2
    9 months ago

    For Debian based/descended distros:

    sudo apt-get update && sudo apt-get upgrade
    

    And technically I also regularly use

    redshift -O 3000
    

    all of the blue light filter programs try to align themselves with a user’s geographic location and time, but I don’t keep normal hours

    • Destide
      link
      fedilink
      English
      99 months ago

      Chuck the -y in there for extra lazy mode

      • @[email protected]
        link
        fedilink
        69 months ago

        I would but much like somebody else’s recent post I have in the past nuked my install by blindly agreeing to some recommended software removals before. These days I like to double check what packages are being updated and replaced.

  • SinkingLotus
    link
    fedilink
    English
    369 months ago

    Sudo !!

    It reruns the last command as sudo.

    Pretty useful since I’m always forgetting.

  • Bob
    link
    fedilink
    59 months ago

    I use “ping” every time I suspect my internet might be going a bit slow.

    • @[email protected]
      link
      fedilink
      19 months ago

      Try mtr . It’ll run kinda like a trace route but will show you where the delay is happening. Still relys in icmp not being blocked

      • Bob
        link
        fedilink
        19 months ago

        ‘mtr’ is not recognized as an internal or external command, operable program or batch file.

        I assume I’m on the wrong OS.

  • @[email protected]
    link
    fedilink
    39 months ago

    Zoxide, dust, fd, rg, btm, tokei. So many newer Rust tools that are way better than the old stuff.

  • @[email protected]
    link
    fedilink
    99 months ago

    diff -y -W 200 file1 file2

    Shows a side by side diff of 2 files with enough column width to see most of what I need usually.

    I have actually aliased this command as diffy

    ctrl-r

    searching bash history

    du -sh * | sort -h

    shows size of all files and dirs in the current dir and sorts them in ascending order so you can easily see the largest files or dirt ant the end of the list

    ls -ltr

    Shows the most recently modified files at the end of the listing.

  • I Cast Fist
    link
    fedilink
    29 months ago

    More of a shortcut, CTRL + A + D to exit the current session (exits a sudo su first, then a ssh, then the actual terminal)