Copy entire line in bash (terminal) - keyboard shortcut

how can I do that?

I can paste a line with ctrl+p; but I dont know how to copy it?

ctrl+y - just deletes etc.

I'm not sure I completely follow what you want, but is it maybe this?

  • You're in the middle of typing a command and realize you want to do something else first, but you don't want to waste the typing you've done.
  • Ctrl-u (delete the whole line from start to where the cursor is and copy it)
  • Enter and run the other command
  • Ctrl-y (copy the bit you deleted back)
  • Finish typing that second command and run it

If that's the scenario, you probably want something like that.

Since this was one month ago ... I don't know as well! But thank you... looks pretty cool this suggestions