emacs(1)
Emacs is a highly extensible and customizable text editor and computing environment.
Synopsis
emacs [OPTION]... [FILE]...Description
Emacs is a powerful text editor that goes far beyond basic file editing—it's a complete computing environment with built-in support for email, news, debugging, version control, and scripting via Emacs Lisp. It features a modular design that allows users to extend functionality without recompiling.
Emacs operates in modes that provide context-specific keybindings and commands. Major modes handle different file types (Python, C, Markdown, etc.), while minor modes add optional features like spell-checking or line numbering. The editor uses a kill ring for clipboard management and provides both interactive and batch processing capabilities.
Common options
| Flag | What it does |
|---|---|
-nw | Open Emacs in terminal mode (no GUI window) |
-q | Don't load the user's init file (~/.emacs or ~/.emacs.d/init.el) |
-l FILE | Load Emacs Lisp file before processing command line |
-eval EXPR | Evaluate the Lisp expression EXPR after startup |
-batch | Run Emacs in batch mode (non-interactive, exits after processing) |
+LINE:COLUMN | Jump to the specified line and column number in the opened file |
-fn FONT | Set the default font (GUI mode only) |
-geometry WxH+X+Y | Set the window size and position (GUI mode only) |
--no-init-file | Same as -q; skip loading init file |
-u USERNAME | Load the init file from a different user's home directory |
Examples
Open myfile.txt in Emacs (creates a new window or uses existing Emacs session)
emacs myfile.txtOpen myfile.txt in Emacs running in the current terminal window
emacs -nw myfile.txtOpen myfile.txt and position cursor at line 42, column 10
emacs +42:10 myfile.txtStart Emacs in terminal mode without loading your custom configuration
emacs -q -nwRun Emacs in batch mode to execute a Lisp expression, then exit immediately
emacs -eval '(message "Hello World")' -batchLoad a custom configuration file before opening myfile.txt
emacs -l ~/.emacs.d/custom-config.el myfile.txtRun Emacs in batch mode to call a custom function for automated processing
emacs -batch -l process-file.el -f my-batch-functionStart Emacs as a background server for faster subsequent client connections
emacs --daemon