lee-pai-long
6/10/2018 - 10:04 PM

Ctrl-U Ctrl-Y command line trick

[BASH] Ctrl-U Ctrl-Y command line trick

Use case:

You’re typing a command, for example you're typing: [sudo] apt-get upgrade, but suddenly realize you should execute [sudo] apt-get update first.

Solution:

Go at the end of your current command with Ctrl-E, then press Ctrl-U, type and execute the other command, then press Ctrl-Y.

Tadaa!