Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Bash

zip with find

find . -type f  -print  | zip k.zip -@
https://snipt.net/embed/42503fad33e519f0f8490094329a77d2/
https://snipt.net/raw/42503fad33e519f0f8490094329a77d2/
42503fad33e519f0f8490094329a77d2
bash
Bash
1
2016-12-03T00:35:27
True
False
False
Oct 08, 2015 at 08:20 AM
/api/public/snipt/141578/
zip-with-find
<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>find . -type f -print <span class="p">|</span> zip k.zip -@ </span></pre></div> </td></tr></table>
"find. linux", bash, zip

Text only

Zip a Folder in Linux

zip -9 -r <zip_file_name> <folder_name>
https://snipt.net/embed/f38874c4a765cfa9a855b8f1dbf36fea/
https://snipt.net/raw/f38874c4a765cfa9a855b8f1dbf36fea/
f38874c4a765cfa9a855b8f1dbf36fea
text
Text only
1
2016-12-02T06:56:48
True
False
False
Feb 20, 2014 at 04:25 AM
/api/public/snipt/115399/
zip-a-folder-in-linux-1
<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>zip -9 -r &lt;zip_file_name&gt; &lt;folder_name&gt; </span></pre></div> </td></tr></table>
linux, zip

Bash

Tar ball tar.gz compress quick

#!/bin/bash
tar -cvzf $1.tar.gz $1
https://snipt.net/embed/55ef009ae34e3468eecef57053db1179/
https://snipt.net/raw/55ef009ae34e3468eecef57053db1179/
55ef009ae34e3468eecef57053db1179
bash
Bash
2
2016-12-02T07:25:34
True
False
False
/api/public/snipt/95069/
tar-ball-targz-compress-quick
<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="ch">#!/bin/bash</span> </span><span id="L-2"><a name="L-2"></a>tar -cvzf <span class="nv">$1</span>.tar.gz <span class="nv">$1</span> </span></pre></div> </td></tr></table>
compress, gz, tar, zip

Bash

extract a specific file from a tar.gz

$ tar xfz abc.tar --wildcards --no-anchored 'redpics*'
https://snipt.net/embed/ab0da6899101a03376177ec62f65a74b/
https://snipt.net/raw/ab0da6899101a03376177ec62f65a74b/
ab0da6899101a03376177ec62f65a74b
bash
Bash
1
2016-12-02T07:24:53
True
False
False
Feb 23, 2013 at 07:10 PM
/api/public/snipt/53824/
extract-a-specific-file-from-a-targz
<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>$ tar xfz abc.tar --wildcards --no-anchored <span class="s1">&#39;redpics*&#39;</span> </span></pre></div> </td></tr></table>
extract, find, gz, tar, zip

Text only

Zip a folder and subfolders using SSH

zip -r -q [NAME].zip *
https://snipt.net/embed/dd0ca3e1c292ed2dd73a7f376ba510cc/
https://snipt.net/raw/dd0ca3e1c292ed2dd73a7f376ba510cc/
dd0ca3e1c292ed2dd73a7f376ba510cc
text
Text only
1
2016-12-02T07:25:46
True
False
False
/api/public/snipt/40113/
zip-a-folder-and-subfolders-using-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>zip -r -q [NAME].zip * </span></pre></div> </td></tr></table>
cmd, command-line, linux, server, ssh, zip

Bash

zip up a directory on linux

zip -r archive_name.zip directory_to_compress
https://snipt.net/embed/492a3ef716b400919af5177a3b08880b/
https://snipt.net/raw/492a3ef716b400919af5177a3b08880b/
492a3ef716b400919af5177a3b08880b
bash
Bash
2
2016-12-02T07:25:49
True
False
False
/api/public/snipt/37663/
zip-up-a-directory-on-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>zip -r archive_name.zip directory_to_compress </span></pre></div> </td></tr></table>
bash, linux, terminal, zip
Copyrighted, illegal, or inappropriate content? Email [email protected].