Emacs: Run Shell in Emacs
Start Shell in Emacs
When in shell, to run the previous shell command, press Ctrl+↑.
Start a Second Shell in Emacs
Call a shell command once
to run a single shell command.
Send text selection to a shell command
Select a region, then Alt+x
For example, select a region, then type Alt+| wc -l Enter. This will print line count of region.
You can have the result replace the selected region. to do that, do
universal-argument 【Ctrl+u】 before calling the shell on region command.
My shell doesn't work in Windows?
Most problems are probably caused by incorrect environment variable setup. See: Emacs in Microsoft Windows FAQ.