• ozymandias@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        1 day 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
          ·
          1 day 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
            ·
            1 day 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
    2
    ·
    edit-2
    5 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

      • ch00f@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        6 days ago

        Shit is usually a pain in the ass. The challenge is divining how much of a pain in the ass something has to be that someone else might have made a solution for it.

        I didn’t know you could ctrl+shift+c to copy in the terminal until a month ago when my linux n00b wife said "there has to be a better way to do this. I’ve been right clicking to copy for 10 years.

      • grrgyle@slrpnk.net
        link
        fedilink
        arrow-up
        2
        ·
        6 days ago

        Congratulations! I remember where I was when I first learned it (in a noisy server room at the back of a machine shop).

        Now pair it with FZF for fuzzy finding – it’s surprisingly easy to set up, just following any guide. It’s insanely useful. I find myself even doing things like typing:

        $ xinput --disable $(xinput --list | grep -i touchpad | grep 'id=[0-9]\+' -o | cut -d= -f2)  # Disable synaptic touchpad trackpad pointer
        

        commands with these like comments on the ends as sort of “tags” so I can ctrl+r search for them later. Yes, I know I could just use a named function, but this is like the step just before that–before I know if I’ll be issuing the same command all the time, or just for the next couple weeks. (This one was from when I was resting my notebook on my laptop.)

        • oddlyqueer@lemmy.ml
          link
          fedilink
          English
          arrow-up
          1
          ·
          6 days ago

          I like this; I have a lot of commands that I don’t use often enough to justify an alias, but still need to rerun all the time. thanks!

  • bdonvr@thelemmy.club
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    6 days ago

    I used to be like this but people seriously. CTRL+R

    Do it. Don’t make this one of those things you’ve heard about and just never got around to trying. Open your terminal right now and CTRL+R and type any part of the command you did before. If the command you want is not showing first just hit CTRL+R again to go to the next one back.

    DO IT.

    Edit: I did learn from this thread today though that ZSH has it set to where you can just type part of what you’re looking for then hit up to do the same thing. Neat!