Updated: 07 May 2023
Pipe command to primary (middle mouse button) clipboard
cmd | xclip
Pipe command to ‘clipboard’ clipboard, for pasting into another application
cmd | xclip -sel clip
Copy contents of file to clipboard, for pasting into another application
xclip -sel clip file.txt