LinuxCommandLibrary

emacs

extensible, customizable text editor and computing environment

TLDR

Open Emacs with a file

$ emacs [path/to/file]
copy
Open a file at a specific line number
$ emacs +[42] [path/to/file]
copy
Open a file at a specific line and column
$ emacs +[42]:[10] [path/to/file]
copy
Run Emacs in terminal mode (no GUI)
$ emacs -nw [path/to/file]
copy
Start Emacs without loading init files
$ emacs -q
copy
Evaluate an Elisp expression and exit
$ emacs --batch --eval '(message "Hello")'
copy
Run Emacs as a daemon for fast client connections
$ emacs --daemon
copy
Connect to an Emacs daemon
$ emacsclient [path/to/file]
copy

SYNOPSIS

emacs [options] [file...]
emacs [+line] [+line:column] [file...]

DESCRIPTION

emacs is an extensible, customizable, self-documenting text editor and computing environment. Far beyond a simple editor, it includes facilities for email, file management, terminal emulation, web browsing, and thousands of other functions through its extension system.
Emacs is built around Emacs Lisp (Elisp), a full programming language that allows users to customize and extend virtually every aspect of the editor. User configurations are stored in ~/.emacs or ~/.emacs.d/init.el.
The editor operates in different modes depending on the file type, providing syntax highlighting, indentation, and mode-specific commands. Major modes handle different file types, while minor modes add optional features. The built-in help system is accessed with C-h (Ctrl+h) or F1.

PARAMETERS

-nw, --no-window-system

Run in terminal mode without GUI (text terminal)
-q, --no-init-file
Do not load the user init file (~/.emacs)
--no-site-file
Do not load the site-wide startup file
-u USER, --user USER
Load specified user's init file
-t FILE, --terminal FILE
Use specified file as terminal
--debug-init
Enable Emacs Lisp debugger during init file processing
--batch
Run in batch mode (non-interactive)
--script FILE
Run specified file as an Emacs Lisp script
--eval EXPRESSION
Evaluate Emacs Lisp expression
-l FILE, --load FILE
Load specified Emacs Lisp file
-f FUNCTION, --funcall FUNCTION
Execute specified Emacs Lisp function
--daemon
Start Emacs as a background daemon
-Q, --quick
Start with minimal configuration (implies -q --no-site-file --no-splash)
--geometry WIDTHxHEIGHT+X+Y
Set window geometry (X11)
-fs, --fullscreen
Start in fullscreen mode
-fw, --fullwidth
Make window as wide as the screen
-fh, --fullheight
Make window as tall as the screen
-fg COLOR
Set foreground color
-bg COLOR
Set background color
-d DISPLAY, --display DISPLAY
Use specified X display
--version
Display version information
--help
Display help information

CONFIGURATION

~/.emacs

User initialization file for Emacs configuration and customization.
~/.emacs.d/init.el
Alternative location for user initialization file, preferred for organizing multiple config files.
~/.emacs.d/
Directory for packages, themes, and additional Elisp files.

CAVEATS

Emacs has a steep learning curve with its extensive keyboard shortcuts. The default keybindings differ from most modern applications (e.g., C-x C-s to save, C-x C-c to quit). Running with -q can help troubleshoot configuration issues. Large files may load slowly without proper configuration. GUI and terminal modes have different capabilities.

HISTORY

Emacs was created by Richard Stallman at MIT in 1976, evolving from earlier editor macros for the TECO editor. GNU Emacs, the most widely used implementation, was first released in 1985 and became the flagship project of the GNU Project. The name originally stood for "Editor MACroS". Emacs inspired the free software movement and remains one of the oldest actively developed software projects. Its rival vi sparked the famous "editor wars" among Unix users.

SEE ALSO

vim(1), nano(1), emacsclient(1), vi(1)

> TERMINAL_GEAR

Curated for the Linux community

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

$1,589.00
Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

$169.99
KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99
GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

$169.99