starts the Mathematica kernel in Unix and Linux.


  • runs the standalone Mathematica kernel. To access the full Mathematica system including the notebook interface, use mathematica.
  • A standalone kernel session normally reads input from (typically a keyboard), evaluates the expression, and prints the results to (typically a display device). Input and output can be redirected using Mathematica commands or standard shell mechanisms.
  • The following command-line options can be given:
  • -mathlinkcommunicate only via MathLink
    -initfile "file"execute the commands in the initialization file during startup
    -lmverboseprint information about interactions with MathLM
    -noinitdo not read any initialization files
    -password "pw"use the password
    -pwfile "file"read passwords from
    -run cmdrun on startup
    -nopromptdo not print banner or In/Out prompts (useful for batch input)
    -script "file"execute the commands from the in a script mode
  • If the -script command-line option is given, the kernel evaluates commands from the in a batch, or script, mode and then terminates.
  • In a script mode the kernel prints no banner and no In[] or Out[] labels, and generates all output in InputForm, with the PageWidth option effectively set to Infinity.
  • In a script mode the standard input and output are not redirected, so that the input and output can be used in a pipe with other processes.
  • In a script mode, the kernel ignores the first line of the file if it starts with the characters "#!".
  • If no command-line options are given, the kernel will read the value of the environment variable and will use that value as though it had been entered on the command line.
  • Unless the Mathematica variable $IgnoreEOF is set to True, the kernel will exit when it receives an end-of-file character sequence. The kernel will always exit when given the command Quit.
New to Mathematica? Find your learning path »
Have a question? Ask support »