xclip

Copy and paste text to/from X11 clipboard from the command line

brewmacoslinux
Try with needOr install directly
Source

About

Access X11 clipboards from the command-line

Commands

xclip

Examples

Copy file contents to clipboard$ cat file.txt | xclip -selection clipboard
Paste clipboard contents to file$ xclip -selection clipboard -o > output.txt
Copy command output directly to clipboard$ echo 'Hello World' | xclip -selection clipboard