How to send data to local clipboard from a remote SSH session

前端 未结 11 1424
别那么骄傲
别那么骄傲 2020-12-07 07:29

Borderline ServerFault question, but I\'m programming some shell scripts, so I\'m trying here first :)

Most *nixes have a command that will let you pipe/red

11条回答
  •  长情又很酷
    2020-12-07 07:50

    @rhileighalmgren solution is good, but pbcopy will annoyingly copy last "\n" character, I use "head" to strip out last character to prevent this:

    #!/bin/bash
    head -c -1 |  ssh desktop pbcopy
    

    My full solution is here : http://taylor.woodstitch.com/linux/copy-local-clipboard-remote-ssh-server/

提交回复
热议问题