Easy solution
You could easily write your own extractor utility in C# using the Microsoft.Office.Interop.OneNote API.
You can find a detailed walkthrough in this msdn article, then you could access the content with a code similar to this:
using System;
using System.Linq;
using System.Xml.Linq;
using Microsoft.Office.Interop.OneNote;
class Program
{
static void Main(string[] args)
{
var onenoteApp = new Application();
string notebookXml;
onenoteApp.GetHierarchy(null, HierarchyScope.hsPages, out notebookXml);
var doc = XDocument.Parse(notebookXml);
var ns = doc.Root.Name.Namespace;
var pageNode = doc.Descendants(ns + "Page").Where(n =>
n.Attribute("name").Value == "Test page").FirstOrDefault();
if (pageNode != null)
{
string pageXml;
onenoteApp.GetPageContent(pageNode.Attribute("ID").Value, out pageXml);
Console.WriteLine(XDocument.Parse(pageXml));
}
}
}
You can read the api documentation here, which also contains a few examples.
Low level approach
In the case your environment does not allow to use this official library, then I don't know of a unix port, but an Office document is stored in XML format. You only need an XML parser to extract the information you need.
Here you have the OneNote format specification. (there is a pdf link to the latest update at the top)
You may then use the parser of your choice and create your little utility. My suggestion for ruby would be libxml.
I hope this suits your needs.