Copy the content of a file to the clipboard from the command line with xclip
Run:
$ xclip -sel clip file.txt
Some people create an alias for xclip -sel clip
.
If you need to install xclip run:
$ sudo apt install xclip
xclip is copyleft-licensed and is maintained by Peter Åstrand.
To learn more about xclip you can run $ man xclip
in the shell.
personal computing gnu linux command-line interface (cli) trisquel xclip wiki office applications shell literacy