top 50 comments

sorted by: hot top controversial new old
[โ€“] 79 points 8 months ago (19 children)
  • [โ€“] 42 points 8 months ago (10 children)

    Yep, thats a good one. Another one, ALT + . inputs the last argument from your last command, pressing it multiple times cycles thorough your past arguments.

  • source
  • parent
  • hideshow 10 child comments
  • [โ€“] 18 points 8 months ago (9 children)

    Nice, 30 years and I didn't know this one. I always use the $! for the last argument.

  • source
  • parent
  • hideshow 9 child comments
  • [โ€“] 8 points 8 months ago (8 children)

    I've never heard of $! but we use Macs at work. Alt+. doesn't work so I've been using $_.

  • source
  • parent
  • hideshow 8 child comments
  • [โ€“] 6 points 8 months ago (7 children)

    โŒฅ+. does the trick for me on MacOS.

  • source
  • parent
  • hideshow 7 child comments
  • load more comments (3 replies)
  • load more comments (2 replies)
    [โ€“] 34 points 8 months ago

    This thread is full of great solutions that I know I will ignore...

  • source
  • [โ€“] 26 points 8 months ago

    Ctrl-R

    Try it. Please, I beg you.

  • source
  • [โ€“] 16 points 8 months ago (1 child)

    I also recommend Atuin, the better shell history that works with most shells and can replace both up arrow and ctrl-r

  • source
  • hideshow 1 child comment
  • [โ€“] 15 points 8 months ago (2 children)

    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.

  • source
  • hideshow 2 child comments
  • [โ€“] 11 points 8 months ago (1 child)

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

    "\e[A": history-search-backward
    "\e[B": history-search-forward
    
  • source
  • parent
  • hideshow 1 child comment
  • [โ€“] 13 points 8 months ago (1 child)

    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.

  • source
  • hideshow 1 child comment
  • [โ€“] 11 points 8 months ago (8 children)

    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.

  • source
  • hideshow 8 child comments
  • load more comments (3 replies)
    [โ€“] 10 points 8 months ago*

    $ sudo apt install sl

    Try sl instead of ls, you'll thank me later

  • source
  • [โ€“] 10 points 8 months ago*

    Reposted yet again.
    meme: bitches dont know bout ctrl-r
    As usual, the documentation covers these answers plus much more.

  • source
  • [โ€“] 9 points 8 months ago

    history | grep 'ls -la' | sed 's/^[[:space:]]*[0-9]\+[[:space:]]*//' | sh

  • source
  • [+] 9 points 8 months ago* (last edited 3 weeks ago) (1 child)
  • [โ€“] 7 points 8 months ago (2 children)

    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!

  • source
  • hideshow 2 child comments
  • [โ€“] 7 points 8 months ago

    ls, ctrl+R

    Significantly less up arrows

  • source
  • ls -alh try that. -h means human-readable file sizes

  • source
  • [โ€“] 5 points 8 months ago (1 child)

    I just alias ls -lah to lsl.

  • source
  • hideshow 1 child comment
  • [โ€“] 4 points 8 months ago (1 child)

    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.

  • source
  • hideshow 1 child comment
  • [โ€“] 3 points 8 months ago (1 child)

    Pro tip, just do:

    alias ls="ls -lah"

  • source
  • hideshow 1 child comment
  • [โ€“] 2 points 8 months ago*

    People talking about history without mentioning the laziest answer is to use an alias, which bash usually has ll = la -la or my personal preference is ll = ls -lAh (list + Everything except . and .. + human readable file size)

  • source
  • [โ€“] 1 point 8 months ago

    is yazi allowed?

  • source
  • load more comments
    view more: next โ€บ