I use “Putty Connection Manager” in Windows, and I was wondering how to do the following.
Often, I find myself editing larger bash commands that have many characters on a single line; nested loops, etc…which are quite long! While I often make use of the “Home” and “End” keys to go to the beginning and end of my line, I’d like a more efficient way to move through the line than simply pressing the Right and Left arrow keys.
vi, for instance, can move forward “by word” if you press the w key (which moves you all the way to the next word)
I’d like to do something similar in a bash shell. Does anyone know of one?
If you’re using the emacs keybindings with bash (I believe that’s the default) try using M-f and M-b to move forward and back words where M is the “Meta” key, probably Alt for you. You can also use C-a (ctrl+a) and C-e to jump to the beginning of lines, even though it seems you already have keys for that. Alt+bksp is also handy to delete whole words.