• Iced Raktajino@startrek.website
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    Pretty much, yeah.

    Rather than jot down in a text file the various ffmpeg commands I use frequently…

    Raktajino@laptop:~/Downloads$ history | grep ffmpeg
       12  sudo apt install audacity gimp ffmpeg mplayer
      215  ffmpeg -i source.mkv -ss 629 -t 7 out.mkv
      217  ffmpeg -i out.mkv -s 0.5 -vf scale=1280:720 out.mp4
      218  ffmpeg -i out.mkv -ss 0.5 -vf scale=1280:720 out.mp4
      231  ffmpeg -i out.mp4 -vf "subtitles=out.srt" final.mp4
      503  ffmpeg -i toofat.wav toofat.mp3
      ...
      682  history | grep ffmpeg
      684  ffmpeg -i 1.gif -i 2.gif -filter_complex "[1:0] [2:0] concat=n=2" out.gif
      685  ffmpeg -i 1.gif -i 2.gif -filter_complex "[1:0] [2:0] concat=n=2:v=1" out.gif
      686  ffmpeg -i 1.gif -i 2.gif -filter_complex "[1:0] [2:0] concat=n=2:v=1" -map '[v]' out.gif
      688  ffmpeg -i 1.gif -i 2.gif -filter_complex "[0:0] 12:0] concat=n=2:v=1" -map '[v]' out.gif
      689  ffmpeg -i 1.gif -i 2.gif -filter_complex "[0:0] 1:0] concat=n=2:v=1" -map '[v]' out.gif
      690  ffmpeg -i 1.gif -i 2.gif -filter_complex "[0:0] [1:0] concat=n=2:v=1" -map '[v]' out.gif
      691  ffmpeg -i 1.gif -i 2.gif -filter_complex "[0:0] [1:0] concat=n=2"  out.gif
      694  history | grep ffmpeg
    
  • PhAzE@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    1 year 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.

  • rumba@lemmy.zip
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year 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.

      • Lebernashi@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        1 year 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
          0
          ·
          1 year 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
            0
            ·
            1 year 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

  • bridgeenjoyer@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    1 year 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

  • Zink@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    1 year 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
      0
      ·
      1 year 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?

  • neclimdul@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 year 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
      0
      ·
      1 year 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.

  • bdonvr@thelemmy.club
    link
    fedilink
    arrow-up
    0
    ·
    1 year 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 it’s not showing first just hit CTRL+R again to go to the next one back.

    DO IT.

      • abbotsbury@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 year ago

        fellow fish user, I just like its autocomplete and how I can just type ‘help’ and an interactive HTML page opens up where I can look stuff, and fish_config does the same except with settings and themes

  • ___f____g___@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    I see everyone posting about Ctrl+R, here’s a couple more useful CLI shortcuts you might enjoy:

    cd - (change directory to $OLDPWD usually the previous directory)

    git checkout - (similarly checkout the previous branch)

    Ctrl+A (return caret to beginning of command, great when you forgot a positional argument and you were almost done typing the command)

    Ctrl+E (similar to Ctrl+A but move to the end of the command)