openbsd-webzine/issues/issue-10/50_TIPS.html

16 lines
452 B
HTML

<article id="tips">
<div class="puffies" aria-hidden="true">🐡🐡🐡</div>
<h2>Shell tips</h2>
<p>
To improve performances or avoid disk i/o, one may mount /tmp in memory (mfs). As example to create a /tmp using 10% of available RAM:
</p>
<pre>
# sed -i '/\/tmp /s/^/\#/' /etc/fstab
# printf "swap /tmp mfs rw,nodev,nosuid,-s=%sB 0 0\n" \
$(dmesg |awk '/avail mem/ { print $4 }') \
>> /etc/fstab
# chmod 1777 /tmp
# mount -a
</pre>
</article>