偶遇一种复制内容到剪贴板的工具

学习Git偶然看到的,记之。

Run the following code to copy the key to your clipboard.

sudo apt-get install xclip
# Downloads and installs xclip. If you don't have `apt-get`, you might need to use another installer (like `yum`)

xclip -sel clip < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard

Alternatively, using your favorite text editor, you can open the ~/.ssh/id_rsa.pub file and copy the contents of the file manually

之前我了解的一种复制方法就是使用 xsel ,命令如下

cat 文件名 | xsel -b

xsel < 文件名

原文地址:https://www.cnblogs.com/Stomach-ache/p/3703171.html