xsel
X11 selection and clipboard manipulation tool. tldr-pages
On Linux
Linux
Use a command's output as input of the clipboard (equivalent to <Ctrl c>)
echo 123 | xsel --input --clipboardIdentifyUse the contents of a file as input of the clipboard
cat path/to/file | xsel --input --clipboardIdentifyOutput the clipboard's contents into the terminal (equivalent to <Ctrl v>)
xsel --output --clipboardIdentifyOutput the clipboard's contents into a file
xsel --output --clipboard >path/to/fileIdentifyClear the clipboard
xsel --clear --clipboardIdentifyOutput the X11 primary selection's contents into the terminal (equivalent to a mouse <MiddleClick>)
xsel --output --primaryIdentify