update some content
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
"articleSection" : "post",
|
||||
"name" : "Transfer File Content Using Xclip in Terminal",
|
||||
"headline" : "Transfer File Content Using Xclip in Terminal",
|
||||
"description" : "\x3cp\x3e工作上常會需要用ssh登入遠端主機檢查LOG,有必要的時候,還要把log複製回本機來處理。\x3c\/p\x3e\n\x3cp\x3e以前都是傻傻的用 scp 傳檔案\x3c\/p\x3e\n\x3cp\x3e之前就記得有這個xclip\/xsel 可以用,但是一直沒有弄清楚怎麼執行\x3c\/p\x3e\n\x3cp\x3e早上研究了一下,順便做個筆記。\x3c\/p\x3e",
|
||||
"description" : "\u003cp\u003e工作上常會需要用ssh登入遠端主機檢查LOG,有必要的時候,還要把log複製回本機來處理。\u003c\/p\u003e\n\u003cp\u003e以前都是傻傻的用 scp 傳檔案\u003c\/p\u003e\n\u003cp\u003e之前就記得有這個xclip\/xsel 可以用,但是一直沒有弄清楚怎麼執行\u003c\/p\u003e\n\u003cp\u003e早上研究了一下,順便做個筆記。\u003c\/p\u003e",
|
||||
"inLanguage" : "en",
|
||||
"author" : "Eric Chang",
|
||||
"creator" : "Eric Chang",
|
||||
@@ -21,8 +21,8 @@
|
||||
"accountablePerson" : "Eric Chang",
|
||||
"copyrightHolder" : "Eric Chang",
|
||||
"copyrightYear" : "2019",
|
||||
"datePublished": "2019-05-17 12:18:54 \x2b0800 CST",
|
||||
"dateModified" : "2019-05-17 12:18:54 \x2b0800 CST",
|
||||
"datePublished": "2019-05-17 12:18:54 \u002b0800 CST",
|
||||
"dateModified" : "2019-05-17 12:18:54 \u002b0800 CST",
|
||||
"url" : "https:\/\/h.cowbay.org\/post\/transfer-file-content-using-xclip-in-terminal\/",
|
||||
"wordCount" : "343",
|
||||
"image" : "https://h.cowbay.orghttps://h.cowbay.org/images/post-default-11.jpg"",
|
||||
@@ -45,9 +45,9 @@
|
||||
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
|
||||
|
||||
<link href="https://h.cowbay.org/css/style.css?v=1632901489" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
|
||||
<link href="https://h.cowbay.org/css/style.css?v=1634607506" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
|
||||
|
||||
<link href="https://h.cowbay.org/css/custom.css?v=1632901489" rel="stylesheet" type='text/css' media='all'>
|
||||
<link href="https://h.cowbay.org/css/custom.css?v=1634607506" rel="stylesheet" type='text/css' media='all'>
|
||||
<link rel="shortcut icon" href="https://h.cowbay.org/img/favicon.ico" type="image/x-icon">
|
||||
<link rel="icon" href="https://h.cowbay.org/img/favicon.ico" type="image/x-icon">
|
||||
|
||||
@@ -308,11 +308,11 @@ if (!doNotTrack) {
|
||||
<p>以前都是傻傻的用 scp 傳檔案</p>
|
||||
<p>之前就記得有這個xclip/xsel 可以用,但是一直沒有弄清楚怎麼執行</p>
|
||||
<p>早上研究了一下,順便做個筆記。</p>
|
||||
<h3 id="1-ssh-要加上--x-">1. ssh 要加上 -X</h3>
|
||||
<h3 id="1-ssh-要加上--x">1. ssh 要加上 -X</h3>
|
||||
<p>不然會出現</p>
|
||||
<pre><code>Error: Can't open display: (null)
|
||||
<pre tabindex="0"><code>Error: Can't open display: (null)
|
||||
</code></pre><p>這種錯誤訊息</p>
|
||||
<pre><code>-X Enables X11 forwarding. This can also be specified on a per-host basis in a configuration file.
|
||||
<pre tabindex="0"><code>-X Enables X11 forwarding. This can also be specified on a per-host basis in a configuration file.
|
||||
|
||||
X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user's X
|
||||
authorization database) can access the local X11 display through the forwarded connection. An attacker may then be able to perform activi‐
|
||||
@@ -320,8 +320,8 @@ if (!doNotTrack) {
|
||||
|
||||
For this reason, X11 forwarding is subjected to X11 SECURITY extension restrictions by default. Please refer to the ssh -Y option and the
|
||||
ForwardX11Trusted directive in ssh_config(5) for more information.
|
||||
</code></pre><h3 id="2-remote-主機要安裝-xclip--xsel-">2. remote 主機要安裝 xclip / xsel</h3>
|
||||
<pre><code>2019-05-17 10:12:20 [minion@hqs019 ~]$ sudo apt install xsel
|
||||
</code></pre><h3 id="2-remote-主機要安裝-xclip--xsel">2. remote 主機要安裝 xclip / xsel</h3>
|
||||
<pre tabindex="0"><code>2019-05-17 10:12:20 [minion@hqs019 ~]$ sudo apt install xsel
|
||||
Reading package lists... Done
|
||||
Building dependency tree
|
||||
Reading state information... Done
|
||||
@@ -358,7 +358,7 @@ Setting up xclip (0.12+svn84-4build1) ...
|
||||
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
|
||||
</code></pre><h3 id="3執行方式">3.執行方式</h3>
|
||||
<p>執行以下指令,就可以把遠端的檔案內容傳送到「系統剪貼簿」,在本機就可以直接貼上了</p>
|
||||
<pre><code>cat copy_neonexus.csv |xclip -selection clipboard
|
||||
<pre tabindex="0"><code>cat copy_neonexus.csv |xclip -selection clipboard
|
||||
</code></pre>
|
||||
</article>
|
||||
</div>
|
||||
@@ -646,7 +646,7 @@ title="pinterest icon"></i>
|
||||
</div>
|
||||
<script src="https://h.cowbay.org/js/jquery.min.js"></script>
|
||||
<script src="https://h.cowbay.org/js/jquerymigrate.js"></script>
|
||||
<script src="https://h.cowbay.org/js/production.min.js?v=1632901489"></script>
|
||||
<script src="https://h.cowbay.org/js/production.min.js?v=1634607506"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user