Last Updated: February 25, 2016
·
812
· jairtrejo

Move around the command line faster

You know how you have to use the arrow keys to move char by char around a command line? It sucks. A couple of shortcuts that make it easier are:

Ctrl + A Go to the beginning of the line.
Ctrl + E Go to the end of the line.
Ctrl + W Erase the previous word.

Also, I sometimes have to do two or three things to the same file. For that I use !^, that inserts the argument of the previously executed line:

$ cat /home/jair/very/long/path/file.txt
   This file should not be here.
$ mv !^ somewhere/else