A blog about software by Alexander Yaäkov Garber.

Copy a file's contents in one line

If you ever wanted a quick and easy to get the contents of a file:

Shell Script

#!/usr/bin/env sh
cat $1 | xclip -selection c

Directly on the commandline, for a file called hello_world.txt

cat hello_world.txt | xclip -selection c