Shell tips

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:

# 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