Free Command - View Used & Available Memory

On Linux, I am use to just typing "free" to see how much memory is in use and how much is available.

I use the sysinfo command on FreeBSD to view memory information. Unfortunately, I have a few issues/nitpicks with it.

* Running "sysinfo mem" prints a bit too much information, especially when ran under a virtual machines (lots of junk output on unknown voltages).
* While it can still show the desired memory information, "sysinfo mem" gives additional error information when ran as non-root.
* I'm simply use to typing "free" to get information!

So, I made the following script and saved it as /usr/local/sbin/free.

# simple "free" command to display used & available memory

# commands used

# check for sysinfo
if [ ! -f "$S" ]; then
 $P "\nYou need 'sysinfo' installed for this!\n"
 $P "\n(run 'pkg install sysinfo' as root to install it)\n\n"
 exit 1

$P "\n"
$S mem | $T -9

# EoF

Now I can just type "free" (as root or a regular user) and quickly get clean output of memory information.