The netCDF Operators (NCO) comprise a dozen standalone, command-line programs that take netCDF or HDF files as input, then operate (e.g., derive new data, average, print, hyperslab, manipulate metadata) and output the results to screen or files in text, binary, or netCDF formats.
This should be on the PATH, just type the commands. They are: ncbo, ncflint, ncra, ncap, ncatted, ncrename, ncpdq, ncecat, ncks, ncap2, ncwa, ncdiff, ncea, ncrcat.
Comes with manpages but there's much more at http://nco.sourceforge.net/.
Decided to use the Ubuntu packages of this. We used not to because of dependency issues - it depended on a package that broke something local - but this has changed.