Command in minibuffer
M-!: single shell command (only output of current command is save to buffer Shell command output);
C-u M-!: save output of command to current buffer;
M-|: run command on selected region (use visual mode in Evil or M-h of emacs to select region);
Shell Mode
M-x shell: only support line mode command;
You can move your cursor to previous line (you can edit it) and press Enter (Insert or Normal mode both OK in Evil), this command will be copy to last line and be executed.
Delete output of last command: C-c C-o;
Move between "Command Group"(a command and its output): C-c C-p/C-c C-n;
Term Mode
M-x term: is a full shell environment. tab-completion and vi is supported;
Note: Use M-p/M-n to get previous/next commands (like Up/Down arrow key in terminal);
Ref:
-
Chapter 5 in "Learning GNU Emacs";