Tag Archives: osx

The default shell for Leopard users is Bash. Although many GNU/Linux users are familiar with it, not all Mac users take full advantage of its power. Here are some very useful commands and tips I use routinely.

Users and login

Use the root superuser

sudo su -

Alter login variables (such as $PATH, $EDITOR)

nano ~/.profile

Other available shells

  • /bin/ksh
  • /bin/tcsh
  • /bin/csh
  • /bin/zsh

Files management

Output the contents of a file

cat /some/thing

Get 20 lines from the end of a file

tail -n 20 /some/thing

Get the first 20 lines of a file

head -n 20 /some/thing

Create an empty file

touch /some/thing

Redirect the output of a command to a file (overwrites)

command > /some/thing

Redirect the output of a command to a file (appends)

command >> /some/thing

Append the timestamp to a file

touch /backups/backup_`date +%s`.txt

Change to the last directory you were in

cd /var
cd /etc
cd - # will take you to /var

List file size in human-readable units

ls -lh /dir/or/file

Available editors

  • /usr/bin/vi
  • /usr/bin/vim
  • /usr/bin/nano

Applications and processes

Run a process in the background

command &

List running processes

ps ax

The first column will be the PID

Kill a process by pid

kill -9

Kill a process or processes by name (e.g: the Dock)

killall Dock

Open an application (Mac-only)

open /Applications/iTunes.app/

Open up terminal. Copy the link of the latest Lua version and download it:

cd /tmp
wget http://www.lua.org/ftp/lua-5.1.4.tar.gz

Extract and compile:

tar -xzvf lua-5.1.4.tar.gz
cd lua-5.1.4
make macosx

Test and install (if test goes through)

make test
sudo make install

And you’re done!

  • red_preview
  • blue_preview

If you hate the default icons as much as I did, you’ll be relieved. I took chris.ivarson beautiful Gmail icons and adapted them for the OS X Leopard toolbar.

Click here to download the replacement icons, and read the INSTALL file for instructions (downloaded [downloadcounter(gmail-notifier-0.1.zip)] times).

otj_icon_large

As a happy Overflow user, I was pleased to see Stunt Software was also into the invoicing / time tracking applications business.

I tried a number of online alternatives to solve this problem, none of which satisfied me (including the popular Harvest and TickSpot). The simplicity and beauty of On the Job is just what you’d expect for an application that will be assisting you on a daily basis with your work, without getting in your way.