snipt

Ctrl+h for KB shortcuts

Python

List files, folders

import os
os.listdir('.')
https://snipt.net/embed/34d3f5ea267d20a50010d3943befcf40/
/raw/34d3f5ea267d20a50010d3943befcf40/
34d3f5ea267d20a50010d3943befcf40
python
Python
2
2019-06-18T09:57:47
True
False
False
/api/public/snipt/7541/
list-files-folders
<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="kn">import</span> <span class="nn">os</span> </span><span id="L-2"><a name="L-2"></a><span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)</span> </span></pre></div> </td></tr></table>
dir, python

Batchfile

batchfile to remove .svn dirs in all subdirs

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q "%%G"
https://snipt.net/embed/4488a37ce158d21987bbe702af1ee97e/
/raw/4488a37ce158d21987bbe702af1ee97e/
4488a37ce158d21987bbe702af1ee97e
bat
Batchfile
1
2019-06-17T07:45:44
True
False
False
/api/public/snipt/3722/
batchfile-to-remove-svn-dirs-in-all-subdirs
<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><span class="k">FOR</span> <span class="k">/F</span> <span class="s2">&quot;tokens=*&quot;</span> <span class="se">%%</span>G <span class="k">IN</span> <span class="p">(</span><span class="s1">&#39;DIR /B /AD /S *.svn*&#39;</span><span class="p">)</span> <span class="k">DO</span> <span class="k">RMDIR</span> /S /Q <span class="s2">&quot;</span><span class="se">%%</span><span class="s2">G&quot;</span> </span></pre></div> </td></tr></table>
batch, batchfile, dir, svn

Text only

Diff Mac OS X Directories

1
2
3
4
5
6
7
Mac OS X diff directories:
diff -rq dirA dirB

Or, sorted and tidyer:

diff -qr dirA dirB | grep -v -e 'DS_Store' -e 'Thumbs' | 
sort > diffs.txt
https://snipt.net/embed/03f86222b33a87e4ad085fc60fb3bbe3/
/raw/03f86222b33a87e4ad085fc60fb3bbe3/
03f86222b33a87e4ad085fc60fb3bbe3
text
Text only
7
2019-06-16T01:39:41
True
False
False
/api/public/snipt/3097/
diff-mac-os-x-directories
<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> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>Mac OS X diff directories: </span><span id="L-2"><a name="L-2"></a>diff -rq dirA dirB </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a>Or, sorted and tidyer: </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a>diff -qr dirA dirB | grep -v -e &#39;DS_Store&#39; -e &#39;Thumbs&#39; | </span><span id="L-7"><a name="L-7"></a>sort &gt; diffs.txt </span></pre></div> </td></tr></table>
diff, dir, macosx