Emacs: Run Shell in Emacs
Start Shell in Emacs
Alt+x shell
.
Shell on Microsoft Windows
Start a Second Shell in Emacs
Ctrl+u Alt+x shell
Call Previous Shell Command
When in shell, to run the previous shell command, press Ctrl+↑.
Call a shell command once
Alt+x shell-command
【Alt+!】
to run a single shell command.
Send text selection to a shell command
Select a region, then Alt+x shell-command-on-region
【Alt+|】.
For example, select a region, then type Alt+| wc -l Enter. This will print line count of region.
to have output replace region, call Emacs: Universal Argument (prefix arg).