Skip to main content


I can only speak for myself, but I'm going to press ⬆️ a dozen times before I retype a 10 character command. ♻️ @roobre Dumb shell question: Is there a magic readline/bash/shell shortcut that allows me to "stash & clear" a command I've partially written so I can run something else, and then continue later?

E.g. when I'm writing a lengthy cp command and midway I realize I have yet to mkdir the dest dir.

URL: https://raru.re/@roobre/112693630975764350


Dumb shell question: Is there a magic readline/bash/shell shortcut that allows me to "stash & clear" a command I've partially written so I can run something else, and then continue later?

E.g. when I'm writing a lengthy `cp` command and midway I realize I have yet to mkdir the dest dir.

EDIT: Ctrl-U, then Ctrl-Y seems to be the way.


in reply to GNU Too

Ctrl-a, then prepend my fuckup with a simple resolution such as mkdir <cpdest> && is usually my goto solution.