Posts Tagged ‘terminal’

Using whereis on Mac OS X Lion

Saturday, January 5th, 2013 | Life, Tech

Linux has a great tool called whereis that allows you to find the location of an executable. For example, if you want to know what PHP binary you are using, you could use the following command.

$ whereis php
/usr/local/php

However, if you run this on Mac it will often return you a black result, even though you know the command works!

$ whereis convert

The solution is to use which instead, which does the the same thing, but actually returns results.

$ which convert
/opt/local/bin/convert

Great for finding those extra mysterious programmes.

View disk space usage by directory in Linux

Wednesday, March 21st, 2012 | Life, Tech

If you need to get a break down of how much space each directory is using, you can do that using the du command. Using a few choice options it will produce a list of all directories in the current folders and how big they are.

du -sch

Uncompress a .tar.gz file

Sunday, December 25th, 2011 | Life, Tech

Need to uncompress a .tar.gz file from the terminal? No problem.

tar xvzf filename.tar.gz