In Mac you can use
$ pbcopy < hello.txt
In Linux which is using X11 (I am using ubuntu), you can use
$ sudo apt install xsel $ xsel -b < hello.txt
To copy some program's output to clipboard, we can use pipe:
$ date | xsel -b
Then if you use "ctrl-v", you will see the copied date.
Top comments (0)