summaryrefslogtreecommitdiff
path: root/posts/3
diff options
context:
space:
mode:
Diffstat (limited to 'posts/3')
-rw-r--r--posts/3/index.html10
1 files changed, 5 insertions, 5 deletions
diff --git a/posts/3/index.html b/posts/3/index.html
index 1a5acd0..bef5f11 100644
--- a/posts/3/index.html
+++ b/posts/3/index.html
@@ -125,7 +125,7 @@ delete file foo every minute * * * * * rm foo delete file foo every 15 minutes 1
<h3 id="crontab">Crontab</h3>
<p><code>crontab</code> is a useful tool, I really regret that I don&rsquo;t familar it earlier.</p>
<p>It&rsquo;s usage really simple, and these two are my frequent using:</p>
-<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>crontab -e <span style="font-style:italic">#edit crontab file that reside in /var/spool/cron</span>
+<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>crontab -e <span style="font-style:italic">#edit crontab file that reside in /var/spool/cron</span>
</span></span><span style="display:flex;"><span>crontab -l <span style="font-style:italic">#list current crontab job</span>
</span></span></code></pre></div><p>It basic syntax as follow, also really simple
<img src="https://assets.garhve.com/pictures/screenshots/2022/08/1857817000.jpg" alt="crontab-layout.jpg"></p>
@@ -185,7 +185,7 @@ e.g. <code>echo path/to/most/inner/file | cut -d '/' -f1</code> this will give m
</blockquote>
<h3 id="daily-update-bt-tracker">Daily update bt tracker</h3>
<p>I already learn shell script for a while.. so I wrote a simple script to test whether I really got used to it, but result is obviously, I need more and more practice to memorize commands.</p>
-<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="">#! /bin/sh
+<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="">#! /bin/sh
</span></span></span><span style="display:flex;"><span><span style=""></span><span style="font-style:italic">#bt-tracker.txt</span>
</span></span><span style="display:flex;"><span>site=https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt
</span></span><span style="display:flex;"><span>
@@ -231,15 +231,15 @@ e.g. <code>echo path/to/most/inner/file | cut -d '/' -f1</code> this will give m
<ul>
<li>This will only search through those files which have .c or .h extensions:</li>
</ul>
-<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>grep --include=<span style="font-weight:bold;font-style:italic">\*</span>.{c,h} -rnw <span style="font-style:italic">&#39;/path/to/somewhere/&#39;</span> -e <span style="font-style:italic">&#34;pattern&#34;</span>
+<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>grep --include=<span style="font-weight:bold;font-style:italic">\*</span>.{c,h} -rnw <span style="font-style:italic">&#39;/path/to/somewhere/&#39;</span> -e <span style="font-style:italic">&#34;pattern&#34;</span>
</span></span></code></pre></div><ul>
<li>This will exclude searching all the files ending with .o extension:</li>
</ul>
-<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>grep --exclude=<span style="font-weight:bold;font-style:italic">\*</span>.o -rnw <span style="font-style:italic">&#39;/path/to/somewhere/&#39;</span> -e <span style="font-style:italic">&#34;pattern&#34;</span>
+<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>grep --exclude=<span style="font-weight:bold;font-style:italic">\*</span>.o -rnw <span style="font-style:italic">&#39;/path/to/somewhere/&#39;</span> -e <span style="font-style:italic">&#34;pattern&#34;</span>
</span></span></code></pre></div><ul>
<li>For directories it&rsquo;s possible to exclude one or more directories using the <code>--exclude-dir</code> parameter. For example, this will exclude the dirs dir1/, dir2/ and all of them matching *.dst/:</li>
</ul>
-<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>grep --exclude-dir={dir1,dir2,*.dst} -rnw <span style="font-style:italic">&#39;/path/to/somewhere/&#39;</span> -e <span style="font-style:italic">&#34;pattern&#34;</span>
+<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>grep --exclude-dir={dir1,dir2,*.dst} -rnw <span style="font-style:italic">&#39;/path/to/somewhere/&#39;</span> -e <span style="font-style:italic">&#34;pattern&#34;</span>
</span></span></code></pre></div><p>more info could see <a href="https://ss64.com/bash/grep.html"><code>man grep</code></a>.</p>
</blockquote>