What The F**k


What the F**k
When I first heard about this tool, I laughed for about five minutes and said to myself thats a good joke those guys have played. That is until I actually tried it out for myself and found it to probably be one of the best command line helpers that i've installed onto my machine.
What is it?
According to their readme
The Fuck is a magnificent app, inspired by a @liamosaur tweet, that corrects errors in previous console commands.
Personally i've found this app to be a great help when it comes to messing up my spelling, especially since i've just bought a Dygma Raise and i'm currently getting used to the split keyboard layout.
Installation
On OS X, you can install The Fuck via Homebrew (or via Linuxbrew on Linux):
brew install thefuck
On Ubuntu / Mint, install The Fuck with the following commands:
sudo apt update
sudo apt install python3-dev python3-pip python3-setuptools
sudo pip3 install thefuck
On FreeBSD, install The Fuck with the following commands:
pkg install thefuck
On ChromeOS, install The Fuck using chromebrew with the following command:
crew install thefuck
On other systems, install The Fuck by using pip:
pip install thefuck
Usage
Lets say you type the following
git brnch
The next thing you are going to see in your terminal is a message asking did you mean
did you mean
git branch
but now instead of typing the whole thing we can simply say
fuck
this will then give you the previous command corrected but will also give you some other options if it thinks you meant something else. Once you hit enter it will run git branch for you.
thewebuiguy@mbp Desktop % git brnch
git: 'brnch' is not a git command. See 'git --help'.
The most similar command is
branch
thewebuiguy@mbp Desktop % fuck
git branch [enter/↑/↓/ctrl+c]
Examples
Install Vim
➜ apt-get install vim
> E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
> E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
>
> ➜ fuck
> sudo apt-get install vim [enter/↑/↓/ctrl+c]
> [sudo] password for nvbn:
Reading package lists... Done
Git push
➜ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
➜ fuck
git push --set-upstream origin master [enter/↑/↓/ctrl+c]
Counting objects: 9, done.
Further reading
To find out more about this tool you can find their full documentation here