How to copy files to the clipboard

When you work in the graphical user interface (GUI) of your operating system, and want to copy the contents of a file to the clipboard, you can use the following commands:

On OS X run: cat FILE_NAMEĀ | pbcopy
On Linux run: cat FILE_NAME | xclip
On Windows (via Cygwin/Git Bash) run: cat FILE_NAME | clip

Leave a comment

Your email address will not be published. Required fields are marked *