The Fuck – intelligent corrector of typos in the terminal

The Fuck - intelligent corrector of typos in the terminalThe Fuck – intelligent corrector of typos in the terminal

The action program with the lyrical name of The Fuck like magic: the user types in the terminal, but, for example, makes a mistake. For example, to attribute sudo forgets or makes a typo. Then he writes at the command prompt, the word fuck and the program fixes it.

Actually, no magic. The program takes an error message after entering the previous command and tries to match with a pre-written sample. If a match is found, the rule is triggered and the command is adjusted. Although rules has been written very much, the user is left to add its own.

The example of the programcorrector The Fuck

apt-get install vim[/simterm]

Could not open lock file /var/lib/dpkg/lock – open (13: Permission denied)
Unable to lock the administration directory (/var/lib/dpkg/), are you root?[/simterm]

fuck[/simterm]

sudo apt-get install vim[/simterm]

The Fuck understands options and specialized programs. Here is an example for Git:

git brnch[/simterm]

git: ‘brnch’ is not a git command. See ‘git –help’.[/simterm]

fuck[/simterm]

git branch[/simterm]

The Fuck - intelligent corrector of typos in the terminalThe Fuck – intelligent corrector of typos in the terminal

Installation latest version into Linux Mint:

Installation is through PIP package Manager – staff Manager for package management in Python

sudo apt update
sudo apt install python3-dev python3-pip
sudo -H pip3 install thefuck[/simterm]

You should place this command in your .bashrcChanges will be available only in a new shell session.

gedit ~/.bachrc[/simterm]

Insert this line

eval “$(thefuck –alias)”[/simterm]

You can use whatever you want as an alias, like for Mondays:

eval “$(thefuck –alias FUCK)”[/simterm]

The Fuck - intelligent corrector of typos in the terminalThe Fuck – intelligent corrector of typos in the terminal

Since the program is bypassing the system’s package Manager, then the update will look different:

sudo pip3 install thefuck –upgrade[/simterm]

Good Luck!!!

https://github.com/nvbn/thefuck

Share to friends
Shekin
Rate author
( No ratings yet )
MintGuide.Org
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments