Command line string navigation cheat sheet

Thanks to Clément Chastagnol for making a very useful cheatsheet for horizontally navigating a string in terminal, which you shall print and attach under your monitor, you can find it on his blog:

https://clementc.github.io/blog/2018/01/25/moving_cli/

Meta key mapping

To be used properly, the “meta” key has to be available as “modifier” to the CLI app you’re using, on each OS and CLI app the procedure may be different, a comprehensive list:

https://www.emacswiki.org/emacs/MetaKeyProblems

On Mac’s Terminal app, it’s a checkbox in the app’s Preferences > Profiles > Keyboard settings.

Short cuts with arrow keys

Some of the above mentioned shortcuts can be achieved also with the more intuitive arrow keys, eg to jump to the start/end of a word or between words:

Ctrl – B left arrow
Alt – B Alt – left arrow
Ctrl – F right arrow
Alt – F Alt – right arrow

which framed with his same visual way would be:

B & F lateral char/word movements with arrow keys

https://sresc.io/tMG

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.