Emacs: Command Line Options

By Xah Lee. Date: . Last updated: .

here's the most useful emacs command line options.

--no-init-file or -q
Do not load Emacs Init File, nor global users init default.el.
--no-site-file
Do not load the site-wide init file site-start.el
-Q or --quick
same as --no-init-file --no-site-file --no-splash.

Start emacs in terminal

--no-window-system or -nw
start emacs in terminal.

Start emacs without loading desktop (previously opened files)

--no-desktop
start emacs without loading previously opened files. [see Emacs Init: Restore Opened Files (desktop-save-mode)]

this is is useful when you have a corrupt desktop file.

Load a Different Init

emacs -q -l InitFilePath
load a different init.

Load Emacs Lisp Files

--load=path or -l path
Run the elisp file at path.
--batch
  • Do not launch emacs as a editor.
  • Do not load user init.
  • Usually used together with --load
--script path

same as --batch and --load

Reference

Emacs Start Up and Init Files