Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Bash

SCP file from local to remote server over ssh using pem key

scp -i /path/to/key.pem /path/to/file.jpg <username>@<server ip address>:/path/to/place/file
https://snipt.net/embed/e1839c5e3d32b62b6ee527d714e4b2f8/
https://snipt.net/raw/e1839c5e3d32b62b6ee527d714e4b2f8/
e1839c5e3d32b62b6ee527d714e4b2f8
bash
Bash
1
2016-12-05T09:30:26
True
False
False
/api/public/snipt/87287/
scp-file-from-local-to-remote-server-over-ssh-using-pem-key
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>scp -i /path/to/key.pem /path/to/file.jpg &lt;username&gt;@&lt;server ip address&gt;:/path/to/place/file </span></pre></div> </td></tr></table>
copy, file, local, remote, scp, server, ssh, to

Bash

SCP (secure copy) file from local machine to remote server over SSH

scp /local-file/folder/name.zip [email protected]:path-to-post-too/subfolder/
https://snipt.net/embed/caf9a9fd1a7a1e3fa7ff1616bd01af69/
https://snipt.net/raw/caf9a9fd1a7a1e3fa7ff1616bd01af69/
caf9a9fd1a7a1e3fa7ff1616bd01af69
bash
Bash
1
2016-12-05T07:45:41
True
False
False
/api/public/snipt/42328/
scp-secure-copy-file-from-local-machine-to-remote-server-over-ssh
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>scp /local-file/folder/name.zip [email protected]:path-to-post-too/subfolder/ </span></pre></div> </td></tr></table>
bash, scp, ssh

Text only

Transfer a filer from server to server over SCP in Linux

scp filename.zip [email protected]:path
https://snipt.net/embed/ff844d5c726639a4ee4f4c8b228bba06/
https://snipt.net/raw/ff844d5c726639a4ee4f4c8b228bba06/
ff844d5c726639a4ee4f4c8b228bba06
text
Text only
1
2016-12-02T16:41:13
True
False
False
Jan 15, 2014 at 08:55 PM
/api/public/snipt/41169/
transfer-a-filer-from-server-to-server-overscp-in-linux
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>scp filename.zip [email protected]:path </span></pre></div> </td></tr></table>
command-line, console, linux, scp, server

Bash

Copy a file from one machine to another using scp

1
2
3
Example of copying config.php to the /tmp directory on 10.10.132.67 with user 'sander' on port 2145

scp -P 2145 config.php [email protected]:/tmp/
https://snipt.net/embed/f157419363fde992f66e5bec39944e66/
https://snipt.net/raw/f157419363fde992f66e5bec39944e66/
f157419363fde992f66e5bec39944e66
bash
Bash
3
2016-12-02T13:51:57
True
False
False
/api/public/snipt/38059/
copy-a-file-from-one-machine-to-another-using-scp
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>Example of copying config.php to the /tmp directory on 10.10.132.67 with user <span class="s1">&#39;sander&#39;</span> on port 2145 </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>scp -P <span class="m">2145</span> config.php [email protected]:/tmp/ </span></pre></div> </td></tr></table>
scp, ubuntu

Bash

scp multiple files from one remote directory

# note that might not work everywhere (for instance, I couldn't get it to work on an imac)
scp [email protected]:/path/to/files/\{file1.ext,file2.ext\} .
https://snipt.net/embed/ca2769d18d4a4b56672ab2b986ed4ce8/
https://snipt.net/raw/ca2769d18d4a4b56672ab2b986ed4ce8/
ca2769d18d4a4b56672ab2b986ed4ce8
bash
Bash
2
2016-12-03T16:17:00
True
False
False
Apr 03, 2013 at 11:15 PM
/api/public/snipt/27683/
scp-multiple-files-from-one-remote-directory
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># note that might not work everywhere (for instance, I couldn&#39;t get it to work on an imac)</span> </span><span id="L-2"><a name="L-2"></a>scp [email protected]:/path/to/files/<span class="se">\{</span>file1.ext,file2.ext<span class="se">\}</span> . </span></pre></div> </td></tr></table>
bash, scp

Bash

scp file off remote server

scp [email protected]:path/to/file localfile
https://snipt.net/embed/14e391f04b3aeee262e6007638e1aacd/
https://snipt.net/raw/14e391f04b3aeee262e6007638e1aacd/
14e391f04b3aeee262e6007638e1aacd
bash
Bash
1
2016-12-04T23:33:12
True
False
False
/api/public/snipt/26779/
scp-file-off-remote-server
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>scp [email protected]:path/to/file localfile </span></pre></div> </td></tr></table>
scp

Bash

copy file to current folder

 scp -P port_number "[email protected]:'/path/to/file name with spaces'" .
https://snipt.net/embed/9f126c6286d349a613653d11bee8928b/
https://snipt.net/raw/9f126c6286d349a613653d11bee8928b/
9f126c6286d349a613653d11bee8928b
bash
Bash
1
2016-12-04T06:10:38
True
False
False
/api/public/snipt/22492/
copy-file-to-current-folder
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a> scp -P port_number <span class="s2">&quot;[email protected]:&#39;/path/to/file name with spaces&#39;&quot;</span> . </span></pre></div> </td></tr></table>
linux, scp

Bash

find with scp

1
2
3
4
find . -mtime -12 -name \*30.png | xargs -I {} scp '{}' [email protected]:/var/www/images/.

#http://stackoverflow.com/questions/1725286/scp-locates-output-by-xargs
#mtime is modified time
https://snipt.net/embed/cd712909bae37b0627651bf81b5c695c/
https://snipt.net/raw/cd712909bae37b0627651bf81b5c695c/
cd712909bae37b0627651bf81b5c695c
bash
Bash
4
2016-12-04T11:47:04
True
False
False
/api/public/snipt/22248/
find-with-scp
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>find . -mtime -12 -name <span class="se">\*</span>30.png <span class="p">|</span> xargs -I <span class="o">{}</span> scp <span class="s1">&#39;{}&#39;</span> [email protected]:/var/www/images/. </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="c1">#http://stackoverflow.com/questions/1725286/scp-locates-output-by-xargs</span> </span><span id="L-4"><a name="L-4"></a><span class="c1">#mtime is modified time</span> </span></pre></div> </td></tr></table>
find, scp

Text only

Example syntax for Secure Copy (scp)

scp [email protected]:foobar.txt /some/local/directory 
https://snipt.net/embed/7ff080036b15f56e1e92381388ec57ec/
https://snipt.net/raw/7ff080036b15f56e1e92381388ec57ec/
7ff080036b15f56e1e92381388ec57ec
text
Text only
1
2016-11-26T23:22:18
True
False
False
/api/public/snipt/22177/
example-syntax-for-secure-copy-scp
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>scp [email protected]:foobar.txt /some/local/directory </span></pre></div> </td></tr></table>
scp
Copyrighted, illegal, or inappropriate content? Email [email protected].