history | grep 'ls -la' | sed 's/^[[:space:]]*[0-9]\+[[:space:]]*//' | shis yazi allowed?
$ sudo apt install sl
Try sl instead of ls, you’ll thank me later
Let me teach you about reverse-i-search in bash…
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.Nice, 30 years and I didn’t know this one. I always use the
$!for the last argument.I’ve never heard of
$!but we use Macs at work.Alt+.doesn’t work so I’ve been using$_.⌥+.does the trick for me on MacOS.Wow, that’s a new Unicode symbol
Sorry, I should have been more clear … When ssh’d into a remote Unix machine from a Mac, it doesn’t me. I don’t think I’ve tried locally.
I don’t even want to think about how much effort this has saved me.
Yeesh, I just learned something new. Thanks!
And in fish
I was just about to ask how the hell anyone remembers or knows all these commands, thanks for the info! I am trying to learn Linux and get used to using the Terminal more often.
You can also just grep through your
.bash_history
Neat
Huh. And here I had aliased “history | grep” to hgrep and was using that.
ls, ctrl+R
Significantly less up arrows
I also recommend Atuin, the better shell history that works with most shells and can replace both up arrow and ctrl-r
Thanks for that, thats much more comfortable!
This thread is full of great solutions that I know I will ignore…
Ctrl-R
Try it. Please, I beg you.
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.
ooooh that’s nice! i love this threads, my shell gets soo much nicer! thank you all, you are great!
How do you have
cd && ezasetup? With an alias the arguments only get appended to the final command so how is it cding to the correct folder?cdis azoxidealias for me. If I need to navigate by folder content, I haveyazionyYazi is nice but when im navigating shorter directory structures i prefer cd. Question of personal preference as all of this is.
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
Only if it’s a global alias, I think (those are useful for stuff like
alias -g DN=/dev/null)
ls -alhtry that. -h means human-readable file sizescd -will bring you to the last directory you were in.😮
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.
This can be enabled in bash by putting these two lines in
~/.inputrc"\e[A": history-search-backward "\e[B": history-search-forwardMy Nobara installation has those commands mapped to pageup/down by default, so it’s probably a default in other distros too if anyone wants to try it out without editing first
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.
Plain version is the one to pipe output for further processing. ls | wc -l
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.
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
I like the retro text adventure charm of running a verbose
ls -laafter everycd. It’s like entering a new room and reading its description for possible exits and items!this is the sort of cozy thought I love to encounter on the internet
I aliased cd | ls -la to cd so it lists the folder contents eveytime













