Connecting my Roll Up Piano via USB to record MIDI
In the Ubuntu terminal, you can use amidi or aseqdump to monitor MIDI messages.

OS X has no command-line tool to monitor MIDI messages.
You have to use some graphical tool like MIDI Monitor or MIDI-OX.
You can also test it in the Audio/MIDI Setup windows with the "Test Setup" button; when you are playing something, the port icon (the triangle) should turn red.

To record MIDI data, use any MIDI sequencer. There is no reason why GarageBand should not work, but you could try Ardour instead.