Macaulay2 » Documentation
Packages » Macaulay2Doc » setting up Macaulay2 » invoking the Macaulay2 program
next | previous | forward | backward | up | index | toc

# invoking the Macaulay2 program

On systems with a command-line interface, the following commands can be used to start the program.

`M2 [option ...]` | -- starts the program with optional arguments
`M2 file1.m2 ...` | -- reads and executes the specified files

When the program starts up the initialization file init.m2 located in your application directory will be loaded. You can modify this file to preload packages you use often or predefine your favorite field. Further, a log of your inputs to the program will be stored in history.m2. Both behaviors can be prevented by starting the program with `M2 -q` instead.

Other options that can be provided on the command-line may be displayed by running `M2 --help`.

    usage:
        M2-binary [option ...] [file ...]
    options:
        --help             print this brief help message and exit
        --no-backtrace     print no backtrace after error
        --copyright        display full copyright message
        --no-debug         do not enter debugger upon error
        --debug n          debug warning message n by signalling an error
        --int              don't handle interrupts
        --notify           notify when loading files during initialization
                           and when evaluating command line arguments
        --prefix DIR       set prefixDirectory
        --print-width n    set printWidth=n (the default is the window width)
        --restarted        used internally to indicate this is a restart
        --read-only-files  disallow file and socket creation and writing
        --script           as first argument, interpret second argument as name of a script
                           implies --stop, --no-debug, --silent and -q
                           see scriptCommandLine
        --silent           no startup banner
        --stop             exit on error
        --texmacs          TeXmacs session mode
        --version          print version number and exit
        --webapp           WebApp session mode
        --no-core          don't load the Core
        --no-preload       don't load the preloaded packages
        --no-prompts       print no input prompts
        --no-randomize     don't set the random number seed based on the date
        --no-readline      don't use readline
        --no-threads       don't start any additional threads (or tasks)
        --no-time          arrange for the current time to be always 0
        --no-tty           do not treat stdin and stdout as tty's
        -q                 don't load user's init.m2 file or use packages in home directory
        -E '...'           evaluate expression '...' before initialization
        -e '...'           evaluate expression '...' after initialization
        --srcdir '...'     add top source or build tree '...' to initial path
        --check n          run tests to level n
                               n=1: basic tests
                               n=2: test Core
                               n=3: test all packages
    environment:
        EDITOR             default text editor
        GC_INITIAL_HEAP_SIZE      (gc: initial heap size in bytes)
        GC_PRINT_STATS            (gc: turn on logging)
        GC_PRINT_VERBOSE_STATS    (gc: turn on more verbose logging)
        GC_LOG_FILE               (gc: name of log file)
        GC_DUMP_REGULARLY         (gc: dump state regularly)
        GC_NPROCS                 (gc: number of threads to use, linux)

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_getting_started.m2:162:0.