Small List Of GeekTool Commands 25


Small List Of GeekTool Commands


I have a new love on my Mac. That is the application GeekTool. It combines my love of Terminal and my love of the Mac’s GUI. The idea behind GeekTool is to display text on your desktop so you can see useful pieces of information. I like it because I don’t have to keep using Terminal. If you want more information check out my review on iLoveMacApps.

This post will be dedicated to the small Terminal commands that you can use to get the most out of GeekTool. Some will be simple, some will be complicated, but they all help. These have been found all over the Internet, but me not thinking ahead I forgot to write down any links to the authors, if you are the original curator of the little piece of code, please leave a comment and I am sure I can link to your site.

Default Log

One of the best logs I find to have on your Desktop is the following. It shows you useful pieces of information with out random bits thrown in.


View Top Output

There is a lot of ways to view the output of top. The Unix command to view the current CPU usage. To see which one you like run it through Terminal to see which results come out the best for you. Each new line is a separate different command.
top -n 60 -l 2 | tail -61
top -l1 -u -o cpu -S
top -ocpu -FR -l2 -n20 | grep '^....[1234567890] ' | grep -v ' 0.0% ..:' | cut -c 1-24,33-42,64-77

Notice that is a “ell” and then a one on the middle one. Funny code writing.

Uptime With Load

My favourite little tool is uptime. Simply because it output the load for you. With load you can tell how badly your computer is living.


Disk Usage

If you want to view how much disk usage you are taking up simply type the following. You may have to change disk0s2 to a different number depending on your configuration.

df -h | grep disk0s2 | awk '{print "Macintosh HD:", $2, "total,", $3, "used,", $4, "remaining"}'

IP Address

If you are on a dynamic IP address or you simply want to know your IP address, this sort of command is probably very useful.

echo External IP: `curl -s | sed 's/[a-zA-Z<>/ :]//g'`

Internal IP Address

Same as above although this will show you an internal IP.

ifconfig en1 | GREP inet

Current Calendar Month

Pretty simple, a small little calendar


If you want the date you can always use:


Current Homeland Security Threat Level

If you want to know what level your Terrorism you are suffering you can check out the threat level of the homeland security website.

curl -s | grep CONDITION

To be perfectly honest you might as well type:

echo "Elevated"

Because it isn’t going to change any time soon.

Get Server Information

If you have a webserver or other server you can get various pieces of information using SSH, items like top doesn’t seem to work to well although other basic commands do.

ssh name@ 'command1;command2;


Hopefully if you are new to Terminal and code bench some of those command would be useful to you. I did originally want to make this post a lot longer but due to work and other matters that were really out of my control I have had to cut it short. If you know of any more please leave a comment.

If you want to keep up with the latests post from Mac Tricks And Tips I recommend you subscribe to the RSS Feed.

Where To Next?

  • Subscribe To Mac Tricks And Tips