Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Do you use zsh? If not, that's the real game changer. And oh-my-zsh has tons of really good plugins and themes
-
lotd77757yYeah. Search in bash_history :p
With zsh & tsch you'd type a bit then hit arrow up & down.
With fish shell it searches as you type.. :) -
Whoa! There's a search command? I used to end up typing a bunch of times the same thing cause I feel so bored pressing the up key and wait
-
donuts236727yIt works on putty, wooh that is useful... Recovering commands that I need from our admin login on Mondays.
A lot of people login with it during the week so pressing Up to find the command would take forever... -
1. I hate zsh.
2. I love bash.
3. I love fzf.
With FZF, Ctrl-R fuzzy-finds through history... and Ctrl-T for all files recursively in current directory.
https://github.com/junegunn/fzf
Can also be used in Vim for various search tasks. You can actually pipe any set through it for filtering. -
@linuxxx fucking noob 😂
And if you dont find what you want with the given input press again ctrl + r , it will show more results -
@WorstVarNames Oh so if you don't know everything about something you're a noob at it right away?
-
Root797547yPerhaps I should do a rant a week containing useful advice/tips for Ruby/Linux/Windows/OSX? 😋
-
nighter627yOld news for me this. But I have no case for it. Think it is faster with the other shell buildins like ”!!” or ”!command:p”. all these is faster workflow for me then that search
-
zshh38487yYou should check out bashhub for commands history power. It’s great.
Not recommended for work though if you’re typing in sensitive information. I use it only at home. -
@nik123
I hate zsh because I have bash profile since the mid 90's, which is about 10k lines long or so, and totally utterly incompatible with zsh. Doesn't even find matches for my hats, and I like my hats^.
So if I pretend to hate zsh, I'll never have to worry about porting it. -
Kimmax109877y@bittersweet what are you talking about
There are scripts that convert bash histroy to zsh just fine -
bahua128017y@Kimmax
He's not talking about history. He's talking about shell config. The syntax is totally different between bash and zsh. -
aaxa22217y@bittersweet I think fzf is the best discovery I've made in a long time :)
@Linuxxx nice that you found out about CTRL-R, I'm using it every day. I wouldn't be able to live without it, since my teacher introduced me to it 6 months ago :) -
w4tsn33837y@f7u12 you should try thefuck. Just type fuck after you mistyped something or forgot sudo and magic happens
https://github.com/nvbn/thefuck -
w4tsn33837y@Drudge me too! I just learned that if you press 'enter ~ .' in a row you can leave broken ssh sessions. Such a fucking reliever!!
-
There's also forward search, default keybinding is ctrl + S (yet you might have to tweak your system to get it). Incredible useful if you hit R a few times too often and fly past your intended line.
-
Sjoerd1757yI feel pretty stupid now... I always used:
cat ~/.bash_history | grep [command keyword]
:/ -
@Sjoerd Shame! You should have at least been using `history | grep command`. Or the arrow-up key ;P
On a more serious manner: Ignorance is not stupidity. A lot of those things somebody has to show you. That's also why I like pairing up with other developers and ask them "how did you do x?"
Otherwise I'd still be grepping files even though there is silversearcher-ag, be lost within huge json even though there is jq, running vm even though there is docker; the list goes on.
I just had the luck that my mentor showed me reverse search 7 years ago.
Only rarely do I have an awesome idea myself, like: Wouldn't it be awesome to have a tool that jumps into the most relevant folder based on directory name and how often I cd into it -- only to then discover that it already exists: autojump.
Yet as long as you are prepared to integrate productivity boost into your workflow, don't feel bad about it. Your solution did get the job done, now you know a more efficient way to do the same thing. -
sudo-2607yAnd you guys should also put comments after your frequently used commands so that it's easier to get back to by just searching for the comment that you just put!
For instance:
ssh acceptance.node.com #ACK1
And you can just get back to this command by CTRL+R and ACK1 -
@AlexDeLarge Same reason I pretend to hate all people except a select few. Saves me from having to change my config files.
I just discovered ctrl+r in the Linux terminal.
Mother of god this fucker speeds up my workflow!
A massive amount of kudos to the person who made this 😍
rant