Giving a f*ck might actually save you time! π
If you want a video version of this guide:
Or else continue reading. π§π»βπ»
This tool makes me laugh and makes me faster with the command line tools so it's a win-win.
Today we will look at "The F*ck" which is a super helpful CLI tool that lets you use those suggested commands in the terminal without having to retype everything again.
Have you ever had that frustrating moment where you type a wrong command, something like grabbing a new branch with git?
But git from that nice suggestion there already knew what we meant so instead we think "f*ck", and start to type out what we really meant. But thanks to this CLI tool we can just type fuck
and it gives us the suggested command and execute it for us.
So this works with a variety of tools and has a really good matching sequence which you can check out in more detail in their documentation here.
If you are using a Zsh
terminal like myself you may need to add an alias to get it working as I have above (or if you want something a little more suitable for work it's always an option too but there's no fun in not typing "fuck" as you mistype).
You can install it on Windows with pip
and there are a few alternative install guides for Mac and Linux in the docs here:
π https://github.com/nvbn/thefuck
What do you think of The Fuck?
Are you enjoying adding it to your workflow as much as me?
This video was inspired by Daan's awesome article here:
π https://levelup.gitconnected.com/7-command-line-tools-that-make-your-life-easier-d69c38850d6c
Subscribe on CodΓΊ Community
Top comments (23)
Hum, it seems pretty fun though if you use oh-my-zsh together with zsh , you've got a really helpful historic suggestions as you type any character, then just press
up
to see others commands that you have already enters and begins by the same letters.This became essential to me , if you don't know yet, I suggest you to try it out .
However, F*ck seems to be useful for the commands that you have never entered.
I never saw oh-my-zsh before, this looks awesome, I am going to test it out now! Cheers for the tip. β€οΈ
It is absolute magic. Plugins for days and the best CLI experience Iβve ever had. Highly recommend using autojump alongside
fuck
Dang that's a cool recommendation too! Cheers β€π€
I use both and it works. Also, the*ck does not work with Python 3.12.+. Things it depends on were removed in Python 3.12.5. And I have no intention of downgrading my Python version just for this tool!
I imagine using this tool for like 5 years and then going to on-site interview and institutively saying out the word loud after I mistaken JS array methods slice vs splice πππ
Maybe a SFW alias is required π
Hahah, exactly ππ
This tool deserves all our love!
I've been using it for about a year now and it's just magical.
f*uck --yeah
is my favourite thing to type into the terminal π€π½I don't know how I missed it for so long to be honest. But yeah, for some reason, super satisfying way of correcting mistakes π
I'm pretty sure I'd misspell
fuck
too.Executing it again apparently skips all unsuccessful attempts and jumps straight to the last command that is not a typo of
fuck
:How cool is that!
Dang you are battle testing it anyway! That's pretty neat
Been battle-testing it for a few months now, definitely the single most important command in my shell :D
But I keep finding new awesome nuances of this tool, I love it!
Me too buddy, me too...
Awesome! π€©
If you're like me, you probably want to have this in your shell configuration.
Can I abbreviate to
f
? It would make my life easier.There is an alias command to change it to whatever you like so I guess so.
This tool is really useful but as I see the gif it seems really funny π€£ as if you are writing f*uk in anger. By the way loved it.
I shall install it!! Thanks for sharing :)
Just to be sure, it does ask before doing the actual command? (just in case...)
Yes, will let you go up and down and pick the closest commands it can match (even if there are no matches) so it's safe!
This is childish. And I expect you to finally write a real alternative to Microsoft Paint (XP) and Notepad.