The xfilesel program is used to copy the PRIMARY selection into a file and to copy a file contents to PRIMARY selection. It acts as a bridge between applications that support selections and console applications (for example with default Midnight Commander clipboard file ~/.cedit/cooledit.clip).
The installation procedure is
1) xmkmf
2) make
3) make install
usage: xfilesel [-f name] [-selection name]
-file name - path of clipboard file (default value: ~/.clipboard),
for example: -f /dev/tty1, -f /home/mc/.cedit/cooledit.clip
-selection name - name of the selection to use. The default is PRIMARY.
Based on XFree86 xcutsel program. Portions by Maxim Chirkov.