For Linux, 'xclip -c' (copy) and 'xclip -p' (paste) respectively.
For MacOS, 'pbcopy' (copy) and 'pbpaste' (paste), respectively.
For Android, using Termux, 'termux-clipboard-set' (copy) and 'termux-clipboard-get' (paste) respectively. There are also keyboard mnemonics: Ctrl-Alt-C will copy, Ctrl-Alt-V will paste.
I believe there's also a feature on Windows via Cygwin, though it's been a couple of decades since I've had to use it.
Each of the above can read from stdin/stdout or file redirection.
E.g.:
cmd | xc # copy *from* command
xp | cmd # paste *to* command
xc <file # copy *from* file
xp >file # past *to* file