Make CTRL+Arrow keys move forward/backward one word in terminal

EDIT: This was fixed in gutsy 7.10.

In all text editors, CTRL+Left or Right moves forward or backward one word however by default this is not the behavior of the various terminal emulators in ubuntu. First open your ~/.inputrc. You might have to create this file.

gedit ~/.inputrc

Now paste following lines:

"e[1;5C": forward-word
"e[1;5D": backward-word
"e[5C": forward-word
"e[5D": backward-word
"ee[C": forward-word
"ee[D": backward-word

Now save the file and run this command to update the system without rebooting:

source ~/.inputrc

You should now be able to open a terminal, and move forward and backward one word at a time using CTRL + left or right.

One Response to “Make CTRL+Arrow keys move forward/backward one word in terminal”

  1. sandrar Says:

    Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

Leave a Reply