Unix Cheatsheet

Unix Toolbox, a comprehensive Cheatsheet


Some examples:

Process priority

Change the priority of a running process with renice. Negative numbers have a higher priority, the lowest is -20 and "nice" have a positive value.

  1. renice -5 586 # Stronger priority

586: old priority 0, new priority -5
Start the process with a defined priority with nice. Positive is "nice" or weak, negative is strong scheduling priority. Make sure you know if /usr/bin/nice or the shell built-in is used (check with # which nice).

  1. nice -n -5 top # Stronger priority (/usr/bin/nice)
  2. nice -n 5 top # Weaker priority (/usr/bin/nice)
  3. nice +5 top # tcsh builtin nice (same as above!)

Create a memory file system

A memory based file system is very fast for heavy IO application. How to create a 64 MB partition mounted on /memdisk:

  1. mount_mfs -o rw -s 64M md /memdisk
  2. umount /memdisk; mdconfig -d -u 0 # Cleanup the md device

md /memdisk mfs rw,-s64M 0 0 # /etc/fstab entry

  1. mount -t tmpfs -osize=64m tmpfs /memdisk
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License