snipt

Ctrl+h for KB shortcuts

Bash

Clear contents of file but dont delete it

cat /dev/null > file
https://snipt.net/embed/bb4c74f5bb5471cfee5e14aa071214d5/
/raw/bb4c74f5bb5471cfee5e14aa071214d5/
bb4c74f5bb5471cfee5e14aa071214d5
bash
Bash
1
2019-07-10T00:42:23
True
False
False
Sep 03, 2013 at 05:12 AM
/api/public/snipt/78646/
clear-contents-of-file-but-dont-delete-it
<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>cat /dev/null &gt; file </span></pre></div> </td></tr></table>
bash, clear, linux, ssh

Bash

Drush cron

drush cron -v
https://snipt.net/embed/2bba4c24cc9a888c96da07f38d91cf1b/
/raw/2bba4c24cc9a888c96da07f38d91cf1b/
2bba4c24cc9a888c96da07f38d91cf1b
bash
Bash
1
2019-07-15T04:53:55
True
False
False
/api/public/snipt/44213/
drush-cron
<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>drush cron -v </span></pre></div> </td></tr></table>
bash, cron, drupal, drush

Bash

Remove all .svn folders on a directory

find . -type d -name .svn -exec rm -rf {} +
https://snipt.net/embed/8678ce1e40b2a0d9f56e824f8470f665/
/raw/8678ce1e40b2a0d9f56e824f8470f665/
8678ce1e40b2a0d9f56e824f8470f665
bash
Bash
1
2019-07-08T04:02:28
True
False
False
/api/public/snipt/39417/
remove-all-svn-folders-on-a-directory
<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 d -name .svn -exec rm -rf <span class="o">{}</span> + </span></pre></div> </td></tr></table>
bash, svn

Bash

remove files over certain size

find . -type f -size +5M -exec rm {} +  
https://snipt.net/embed/2ebd7cbc09208ecef4937a77ce4bf20b/
/raw/2ebd7cbc09208ecef4937a77ce4bf20b/
2ebd7cbc09208ecef4937a77ce4bf20b
bash
Bash
1
2019-07-16T18:53:18
True
False
False
/api/public/snipt/39150/
remove-files-over-certain-size
<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 -size +5M -exec rm <span class="o">{}</span> + </span></pre></div> </td></tr></table>
bash, server