Copy shell script output to clipboard

后端 未结 6 472
灰色年华
灰色年华 2020-12-23 17:09

Is there any easy way to implement the copy to clipboard option from the output of a shell script ?

6条回答
  •  没有蜡笔的小新
    2020-12-23 17:35

    That may depend on the environment you're using. With Gnome at least (I haven't tried the others but it may work), you can pipe your output as follows:

    echo 123 | xclip
    echo 123 | xclip -sel clip
    

    The first goes to the mouse clipboard, the second to the "normal" clipboard.

提交回复
热议问题