If you type the name of a directory after a C-x C-f
command, Emacs
will display the directory contents in a new buffer. By default, Emacs
displays the file name, permissions, owner/group, size and timestamp
of each file on a line by itself. You can visit a file by just moving
the cursor to it and hitting Enter
. Dired mode is unlike other modes
in that single keys are used to effect commands. Here is a list of the
most useful dired commands:
Left, right arrow keys or p, n | Previous and next file, respectively |
Enter | Visit this file in this window |
o | Visit this file in a new window |
g | Refresh directory view |
m | Mark file |
u | Un-mark file |
d | Mark a file for later deletion |
x | Delete all files marked for deletion (Emacs prompts for confirmation) |
D | Delete this file right now (Emacs prompts for confirmation) |
C | Copy this file, or copy currently marked files (Emacs prompts for destination) |
R | Rename/move this file, or rename/move currently marked files (Emacs prompts for destination) |
M | Chmod this file, or chmod currently marked files (Emacs prompts for new permissions) |
O | Chown this file, or chown currently marked files (Emacs prompts for new owner) |
G | Chgrp this file, or chgrp currently marked files (Emacs prompts for new group) |
+ | Create directory (Emacs prompts for directory name) |
! | Execute shell command on this file, or currently marked files (Emacs prompts for command) |