1

Does anybody out there know the linux keyboard shortcut for skipping words in a command prompt. e.g.,

$ locate pdf | xargs -i ls -l {} | grep something

I'd like to scroll through the command by word by word rather than the default letter by letter.

3 Answers 3

4

In bash you can use CTRL combined with the left and right arrows or ALT combined with F or B.

See keyboard shortcuts, or readline shortcuts.

1
  • Great links! Will make sure to file them away somewhere.
    – andol
    Dec 4, 2009 at 23:26
2

In addition to Zoredache's answer, you can find out the full list of keyboard shortcuts currently available for bash by issuing the command:

bind -P

Additionally, if you're more used to vi-style bindings than emacs-style, you can switch with:

set -o vi

and switch back with

set -o emacs
2

On my macOS Catalina in both bash and zsh, scrolling by word is done with:

ALT + Arrow Left/Right

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .