So in visual Studio you can set the solution to either Debug or Release. With Release automatically setting certain optimizations. My question is, what are the command options that will achieve (a similar) optimization but in the command line (for both windows and linux)?
The build-log, which is generated after you build a project, contains the command line options. You may use those options in your command window session, or place some of the options in the default configuration file, ifort.cfg.
Or just look at the Command Line property page for the Release configuration and you'll see what it uses. Generally, as far as optimization goes, it is just /O2 which is the default anyway. (This assumes you have not changed the settings for that configuration.)