2017-04-26 87 views
0

我正在使用一个Ubuntu的16.04 VPS,我通过从Windows登录腻子。我想复制的输出:将命令的输出复制到windows剪贴板

sudo nginx -T 

我的windows剪贴板。我试过了:

[email protected]:/etc/nginx/sites-available$ sudo nginx -T | xclip -selection c 
Error: Can't open display: (null) 
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok 
nginx: configuration file /etc/nginx/nginx.conf test is successful 

但是没有东西被复制到我的本地剪贴板。我怎样才能做到这一点?

回答

0

您需要将$ DISPLAY环境var传递给该命令。像这样运行:

DISPLAY=:0 sudo nginx -T | xclip -selection c 

如果xclip不工作了,你也可以尝试使用xsel