Copy the contents of a file to clipboard from WSL to Windows?

  • Command:
cat /path/to/file | clip.exe
  • Description:

cat command put the file contents to the output. It is then pipe to the
clip.exe, a Win32 program, redirects output to the Windows clipboard.
Do not forget to add the .EXE extension of the later one. There are multiple
cat alternatives can be used, see this and this.

  • Further Reading:

    • Windows Subsystem for Linux interoperability with Windows

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)