• ozymandias@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        3 days ago

        type part of the command, then press up and it’ll complete it from your history….
        also i suggest Oh-My-Zsh for nice colors in the terminal
        the first time you do it you’ll get angry at all the time wasted in bash… also with oh my zsh it’ll show you what branch you’re in in a git repository… it’s great.

        • Tja@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          3 days ago

          Thanks! I have zsh on some of my machines, and installed zpresto on some but never got the advantages… probably due to bash muscle memory.

          You also can get the git branch in bash, and a bunch of other $PS1 customizations are also possible (Tmux, ssh, time, background processes, etc).

          I’ll try the up completion later :)

          • ozymandias@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            2
            ·
            3 days ago

            yeah you can do anything in bash….
            zsh is really just an extension of bash, imo…
            but the completion alone makes it worth it for me.
            also colors in the terminal

  • PhAzE@lemmy.ca
    link
    fedilink
    arrow-up
    25
    ·
    edit-2
    7 days ago

    Ctrl + R and start typing the command, it’ll come up, press enter. Im just more lazy because I know there are still faster ways.

    Edit: instead of hitting enter, keep pressing ctrl + R to cycle through history commands that contain what you typed in

      • Lebernashi@lemmy.world
        link
        fedilink
        arrow-up
        8
        ·
        7 days ago

        Every time you hit the up arrow, it shows the previous command you used in the terminal.

        So hitting the arrow once gives your last used, hitting it twice gives your second to last command, and so on.

        • djvinniev77@lemmy.ca
          link
          fedilink
          arrow-up
          2
          ·
          7 days ago

          Yup and that is me. I could just history grep the command I want but I SWEAR it was just 2 commands ago, or 15 up arrows. lol.

          • Jarix@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            edit-2
            7 days ago

            Ohhh! I can absolutely relate to this as well! Using a zmud client to play games on. which is probably not much different, looking, than a terminal anyways

              • Jarix@lemmy.world
                link
                fedilink
                arrow-up
                1
                ·
                6 days ago

                Did. It’s long gone

                Was a modified circlemud. Mostly fantasy. Was a mish mash of popular fantasy worlds. Feist, Tolkien, various DnD settings, letter on they tried to go away from fandom content.

                Had any 29 classes, could “remort” keeping 15% of your skills. And had other benefits such as lowering some level requirements here and there.

                Was riftsmud.net:4000 originally but they ended up having to move a could times.

                About 40 players at peak times, maybe 100 players altogether that played any amount

  • rumba@lemmy.zip
    link
    fedilink
    English
    arrow-up
    10
    ·
    7 days ago

    You’re in vim, you forgot to sudo, the file is read only and you have loads of changed you don’t feel like saving off to /tmp and playing the copy file shell game.

    [esc]:w !sudo tee %

    it shoves the current buffer through tee (termina adapter) with sudo privs vim will warn you that the file changed, just [esc]:q! and don’t let it save, you already saved it.

  • Reygle@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    6 days ago

    … And waste an opportunity to type on my ludicrously expensive mechanical keyboard?

    FRIG no

  • Zink@programming.dev
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    7 days ago

    Ah crap how did I set my battery charge interval again?

    history | grep battery

    history | grep bios

    history | grep sudo smbios

    Ah! There you are you little shit!

    edit to add: Actually, I think the last time I did this I remembered some numbers I set it to before. So it worked well with something like “history | grep 75” even though there were a bunch of results.

    • Buddahriffic@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      7 days ago

      Is there a good way to do this when you use a lot of terminal tabs and aren’t sure which tab you used for the command you’re looking for?

  • bridgeenjoyer@sh.itjust.works
    link
    fedilink
    arrow-up
    3
    ·
    7 days ago

    Nah just save all your commands in a text file on the desktop then make an alias to open it in nano so you just have to type “com”. Works for dumb ol me

  • neclimdul@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    7 days ago

    I see so many people loving on atuin in the comments but I just tried it and don’t get it. It seems so much worse than the built in search. I guess it’s not for me.

    • merc@sh.itjust.works
      link
      fedilink
      arrow-up
      3
      ·
      7 days ago

      I’ve been using it for a few months, and so far it’s not as good as just regular old command history. I think any benefit might be for really, really old commands, or commands happening in a specific location. So, I’m going to keep using it to see if it helps then. But, so far it’s a massive downgrade.