Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Cool, works out of the box after upgrading to WSL/Ubuntu 16! Commented Apr 15, 2017 at 22:28
  • 4
    echo didn't work for me, but cat did. That is, entering cat filePath | clip.exe in the command prompt.
    – Jet Blue
    Commented Feb 8, 2018 at 3:21
  • 1
    this works from shell to clipboard, but is there a solution for the reverse? looking for pbpaste or xclip -o equivalent.
    – rev
    Commented Mar 21, 2018 at 1:34
  • 1
    @JetBlue Sounds like you were using echo wrong, then -- echo just prints the text you give it to the output. cat reads a file.
    – anon
    Commented Nov 10, 2018 at 2:14
  • 1
    Something strange happens when I try to use io redirection with the read from clipboard option. I can run it just fine and it will dump the clipboard contents into the command line just fine, but when I try to do e.g. powershell.exe -command "Get-Clipboard" > test.txt, my WSL window appears to lose all personalization settings (font size, typeface) except color scheme. Is this typical?
    – R. Barrett
    Commented Jan 20, 2021 at 23:11