Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Friends Im trying to copy the ssh key on to the clipboard and while on the git bash, Im getting

$ clip < ~/.ssh/id_rsa.pub
sh.exe": clip: command not found

Im using Win7 , I tried using the windows command prompt but no luck,

Please let me know any alternate way

share|improve this question

migrated from stackoverflow.com May 27 '13 at 13:01

This question came from our site for professional and enthusiast programmers.

    
This doesn't really have anything to do with git or GitHub; it's just about clip.exe not being in your path. –  Cairnarvon May 27 '13 at 12:21
    
Thanks , any idea adding clip.exe to the path ? –  ronan May 27 '13 at 12:33
    
open a normal cmd.exe, cd to your .ssh folder and "clip <id_rsa.pub" –  Thorbjørn Ravn Andersen May 27 '13 at 13:47

2 Answers 2

clip.exe should be in C:\Windows\System32\ or C:\Windows\SysWOW64\. You can check if those folders are in your path by doing echo $PATH. If they aren't (which would surprise me), you can add them:

$ export PATH="$PATH:/c/Windows/System32:/c/Windows\SysWOW64"

It's probably more likely clip.exe doesn't exist on your system at all.

However, there's a much simpler way you can manipulate the Windows clipboard from Git Bash (or, for that matter, Cygwin): the clipboard device file, /dev/clipboard.

To write to it:

$ echo "test" >/dev/clipboard

To read from it:

$ cat </dev/clipboard

The equivalent of your command would be:

$ cat ~/.ssh/id_rsa.pub >/dev/clipboard
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.