Last Updated: April 30, 2020
·
23.96K
· jwebcat

copy files to clipboard in windows git bash

for windows 7 users you can access the clipboard from shell too :)

-

  • to copy from a file
$ cat file > /dev/clipboard
  • to paste into a file
$ cat /dev/clipboard > file
  • or to check the contents of the clipboard
$ cat /dev/clipboard

:) enjoy.

3 Responses
Add your response

I get permission denied to the clipboard.

over 1 year ago ·

Hmm are you using an administrator account?

You can also use

$ clip < thing to copy
# then to paste
$ clip > file
over 1 year ago ·

Made sure you have then first /
Like: /dev/clipboard

It should work on windows bash.

over 1 year ago ·