On Linux or FreeBSD (or any BSD), try yahooquote. On FreeBSD, also try yahoo historical quotes in the packages. They are in PERL. I wrote my own code (Java + Scheme) for IB data mining (unfortunately doesn't go back farther than 1 year).