GNU Emacs Manual. Node: Shell

PREV Gnus UP Top NEXT Emacs Server

27.14: Running Shell Commands from Emacs

Emacs has commands for passing single command lines to inferior shell processes; it can also run a shell interactively with input and output to an Emacs buffer named `*shell*'.

M-! cmd RET

Run the shell command line cmd and display the output (shell-command).

M-| cmd RET Run the shell command line cmd with region contents as input; optionally replace the region with the output (shell-command-on-region).
M-x shell Run a subshell with input and output through an Emacs buffer. You can then give commands interactively.

  • Single Shell How to run one shell command and return.
  • Interactive Shell Permanent shell taking input via Emacs.
  • Shell Mode Special Emacs commands used with permanent shell.
  • History Repeating previous commands in a shell buffer.
  • Options Options for customizing Shell mode.
  • Remote Host Connecting to another computer.
  • PREV Gnus UP Top NEXT Emacs Server