Copy to clipboard using Bash for Windows Copy to clipboard using Bash for Windows windows windows

Copy to clipboard using Bash for Windows


In Build 14393 or later, if you want to copy something to clipboard in WSL console, just add '.exe' to what you do in Windows cmd.

echo "aaa"|clip.exe

To read from clipboard:

powershell.exe -command "Get-Clipboard"


In order to copy non-ascii characters (other languages), I had to do this:

echo 'αβψδεφγ' | iconv -f utf-8 -t utf-16le | clip.exe

utf-16le excludes the preceeding BOM so you can paste it back