cmd command pipe file to clipboard code example

Example 1: cmd command pipe file to clipboard

CLIP

Description:
    Redirects output of command line tools to the Windows clipboard.
    This text output can then be pasted into other programs.

Parameter List:
    /?                  Displays this help message.

Examples:
    DIR | CLIP          Places a copy of the current directory
                        listing into the Windows clipboard.

    CLIP < README.TXT   Places a copy of the text from readme.txt
                        on to the Windows clipboard.

Example 2: cmd command pipe file to clipboard

type filename | clip  % OR clip < filename   %windows
cat filename | xclip  # OR xclip < filename  # X11 / Unix / Linux
cat filename | pbcopy # OR pbcopy < filename # MacOS X

Tags:

Misc Example