Celeb Glow
news | March 15, 2026

sh.exe": clip: command not found

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

3

2 Answers

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

This is an old question, but for what it's worth...

I'm running Windows 10 with WSL 2 all configured and I found that clip.exe is present on my system at C:\Windows\System32\ and my path does already include C:\Windows\System32\. All I needed to do was to add .exe to the command in this obvious (to me, anyway) location:

clip.exe < ~/.ssh/id_rsa.pub
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy