1.5. Emacs as a Work Environment

1.5.1. Shell Mode

Shell mode lets you access the UNIX shell without leaving Emacs. A rule of thumb in shell mode is that you preface all ordinary control sequences with C-c. For example, to interrupt a command, type C-c C-c.

To Keystrokes Command Name
Enter shell mode ESC x shell,
Interrupt current job; equivalent to C-c in UNIX shells C-c C-c comint-interrupt-subjob
Delete a character; if at end of buffer send an EOF character C-d comint-delchar-or- maybe-eof
Send EOF character C-c C-d comint-send-eof
Erase current line; C-u> in UNIX shells C-c C-u comint-kill-input
Suspend or stop a job; C-z in UNIX shells C-c C-z comint-stop-subjob
Display previous command; repeat to display earlier commands ESC p comint-previous-input
Display subsequent commands; repeat to display more recent commands ESC n comint-next-input
Execute command on current line RETURN comint-send-input
Complete command, filename, or variable name TAB comint-dynamic- complete
Delete output from last command C-c C-o comint-kill-output
Move last line of output to bottom of window C-c C-e comint-show-maximum- output

1.5.2. Working with Dired

Dired is Emacs's directory editor. It provides a convenient way to manage files and directories.

To Keystrokes Command Name
Start Dired C-x d dired
Copy C dired-do-copy
Flag for deletion d dired-flag-file-deletion
Delete immediately D dired-do-delete
Open file or directory e or f dired-find-file ...

Get GNU Emacs Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.