Is there a shortcut in bash and zsh to delete one component of a path? For example, if I type ls ~/local/color/
, and the cursor is at the end of line, is there a shortcut to delete the color/
at the end? Ideally I want solutions in both vi-mode and emacs-mode
Bash – How to delete part of a path in an interactive shell
bashshellzsh
Best Answer
The most commonly used commands in the default bash emacs mode, for most commonly used keyboards:
Movement
Editing
Miscellanea