For modules, see File::MMagic and File::LibMagic and File::Mimeinfo.
In reply to Re: file(1) equivalent? by Corion in thread file(1) equivalent? by Anonymous Monk