Imagine I do:
echo $PATH
in a terminal. Is is possible that the result is automatically copied so that if I do Ctrl+y it would get printed? As I understand it, when doing Ctrl+k on a terminal, the text is saved in a memory buffer that belongs to the terminal, so I would think something like this should be possible.
Any thoughts?
Depends. Linux, Mac or Windows?
The mac has the commands
pbcopyandpbpasteto copy and paste something from the clipboard.Copy example (mac):
Paste Example (mac):
Linux uses X which has multiple copy-paste buffers (somewhat akin to the clipboard, but a little more involved).
You can use a little application like XSel to copy/paste, The command would be used in the same form as the pbcopy/pbpaste
Copy:
‘paste’:
For windows, you can use an app like clip, which allows the same copy/paste functionality
Copy:
I generally use Linux/Unix so I don’t have the equivalent for pasting from the clipboard on Windows.