HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

clip — Copy input content to the Windows clipboard. More information: <https://learn.microsoft.com/windows-

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommandwindowscopycontentcliinputclip
windows

Problem

How to use the clip command: Copy input content to the Windows clipboard. More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/clip>.

Solution

clip — Copy input content to the Windows clipboard. More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/clip>.

Pipe command-line output to the Windows clipboard:
{{dir}} | clip


Copy the contents of a file to the Windows clipboard:
clip < {{path\to\file.ext}}


Copy text with a trailing newline to the Windows clipboard:
echo {{some text}} | clip


Copy text without a trailing newline to the Windows clipboard:
echo | set /p="some text" | clip

Code Snippets

Pipe command-line output to the Windows clipboard

{{dir}} | clip

Copy the contents of a file to the Windows clipboard

clip < {{path\to\file.ext}}

Copy text with a trailing newline to the Windows clipboard

echo {{some text}} | clip

Copy text without a trailing newline to the Windows clipboard

echo | set /p="some text" | clip

Context

tldr-pages: windows/clip

Revisions (0)

No revisions yet.