[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
41. 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*’ or run a shell inside a terminal emulator window.
- 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.
- M-x term
Run a subshell with input and output through an Emacs buffer. You can then give commands interactively. Full terminal emulation is available.
M-x eshell invokes a shell implemented entirely in Emacs. It is documented in a separate manual. See Eshell: (eshell)Top section `Eshell' in Eshell: The Emacs Shell.
41.1 Single Shell Commands | How to run one shell command and return. | |
41.2 Interactive Inferior Shell | Permanent shell taking input via Emacs. | |
41.3 Shell Mode | Special Emacs commands used with permanent shell. | |
41.4 Shell Prompts | Two ways to recognize shell prompts. | |
41.5 Shell Command History | Repeating previous commands in a shell buffer. | |
41.6 Directory Tracking | Keeping track when the subshell changes directory. | |
41.7 Shell Mode Options | Options for customizing Shell mode. | |
41.8 Emacs Terminal Emulator | An Emacs window as a terminal emulator. | |
41.9 Term Mode | Special Emacs commands used in Term mode. | |
41.10 Page-At-A-Time Output | Paging in the terminal emulator. | |
41.11 Remote Host Shell | Connecting to another computer. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |