You can use the xclip command in Linux to manipulate the X11 clipboard, handling copy and paste in the command prompt and scripts. See xclip and xsel examples:
-> Copy command output to clipboard https://www.cyberciti.biz/faq/xclip-linux-insert-files-command-output-intoclipboard/
-> Copy a file to the clipboard https://www.cyberciti.biz/faq/how-do-i-copy-a-file-to-the-clipboard-in-linux/