Thursday, February 19, 2009

Command Spell Correction in Bash

If you tend to make mistakes while typing, bash can be a a little less than helpful; just spitting out a "No such file or directory." One small hack which helps towards this is the automatic spell correction built into bash. This will correct small typing errors made with the cd command as follows.

user@host:~ $ cd /ect
/etc
user@host:/etc$

It can be enabled for the current shell by

$ shopt -s cdspell

As before, you can make the effect more permanent by echoing the command into .bash_profile.

1 comment:

  1. Do you need to increase your credit score?
    Do you intend to upgrade your school grade?
    Do you want to hack your cheating spouse Email, whatsapp, Facebook, instagram or any social network?
    Do you need any information concerning any database.
    Do you need to retrieve deleted files?
    Do you need to clear your criminal records or DMV?
    Do you want to remove any site or link from any blog?
    you should contact this hacker, he is reliable and good at the hack jobs..
    contact : cybergoldenhacker at gmail dot com

    ReplyDelete