From a-close-date on, Twitter won't let you into their API without having an OAuth key. But as a workaround you can use Search API. It is RESTful, so you can use
curl to retrieve search results in JSON format. For example, if you want to retrieve @java's tweets, and save it to file
~/.tweets, this line of code can be used:
curl http://search.twitter.com/search.json?q=from:java&page=1&rpp=10&callback=? >> $HOME/.tweets
And you can parse the file, using any JSON parser.
parameter is number af tweets to be retrieved.
There are tools to parse JSON from command line interface. Although I've never used one, I'll put some links to some resources, to help you find out the best suited tool:
And as a little note, it is quicker to use some Python or Ruby (or others).