• pedz@lemmy.ca
    link
    fedilink
    arrow-up
    12
    ·
    3 months ago

    To be even more efficient while being lazy, try oh-my-bash. You can start typing the beginning of a command and use arrow up to cycle through only those, instead of the whole history. So if you had a very long mount command and don’t want to type it again, type mount and up arrow until it can be found. Not very useful for ls -al but very appreciated on longer commands.

    • chellomere@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      3 months ago

      I personally use fzf to do basically the same thing, I just have to press ctrl-r before I start to type, and it does fuzzy matching to your history and shows more than one alternative at a time

  • Ada@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    8
    ·
    3 months ago

    In addition to ctrl-r, there is also fish! Fish does something similar to Ctrl-R, but in an easier to use way. Start typing a command, and then press the up arrow. It will cycle through your history, but only the history that includes the text you’ve started typing.

    • Undearius@lemmy.ca
      link
      fedilink
      English
      arrow-up
      6
      ·
      3 months ago

      This can be enabled in bash by putting these two lines in ~/.inputrc

      "\e[A": history-search-backward
      "\e[B": history-search-forward
      
  • AItoothbrush@lemmy.zip
    link
    fedilink
    English
    arrow-up
    6
    ·
    3 months ago

    Very useful tip: i have ls aliased to eza which is ls with eyecandy, I have la aliased to eza -a and I have cd aliased to cd && eza which makes navigating folders very easy. I also aliased … to cd … for convenience. I know a lot of people are purists about the terminal but i think this is a good ballance between convenience and simplicity. Doesnt do a lot of the cursed stuff ricers like to do.

    • DaforLynx@lemmy.zip
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 months ago

      Love convenient aliases. Would aliasing … cause “…/previous/file” to become " cd …/previous/file" and ruin some commands? I guess not. I also use eza :D

      • Prunebutt@slrpnk.net
        link
        fedilink
        arrow-up
        3
        ·
        3 months ago

        Only if it’s a global alias, I think (those are useful for stuff like alias -g DN=/dev/null)

  • Gyroplast@pawb.social
    link
    fedilink
    English
    arrow-up
    4
    ·
    3 months ago

    I like the retro text adventure charm of running a verbose ls -la after every cd. It’s like entering a new room and reading its description for possible exits and items!

  • Zink@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    3 months ago

    I leave ls alone and instead do

    alias l='ls -latrF'
    

    I do sometimes just want to use the plain version, especially if I’m in a small terminal window for some reason. But I think my brain likes scanning 1D lists more than 2D grids, no matter whether I’m in a terminal or using a graphical file manager.