I can see the last command in the terminal by pressing up arrow
as in the following example:
I typed cd /
:
Makss-Mac:~ maks$ cd /
... pressed enter
, command cd /
executed and now I can press up arrow
and see the command cd /
again:
Makss-Mac:/ maks$ cd /
I want to not only see the last command but also copy it to the clipboard.
Maybe there exists a shortcut that not only shows the last command in the terminal (as up arrow
does) but at the same time copies it to the clipboard.
Or maybe there is a shortcut for selecting all from current terminal line. And so I would be able to copy the last command (after pressing up arrow
) by pressing super+c
. Of course I can select it with the mouse. But when commands are 10 times longer than cd /
it can be too time-consuming, especially if you do it every 30 seconds.
Or is there maybe a way to write a plugin for the terminal?