Dired Mode in Emacs
-
Start up Dired mode: C-x d; (List dirs: C-x C-d)
-
Hide Dired mode window: q;
Mark
-
Mark (for group manipulation): [n]m;
-
Mark with regex: %m;
-
Mark files whose contents match regular expression (like mark with grep): %g
-
Mark all directories: */;
-
Mark all executables: **;
-
Toggle marked files/directories (same as inverse selection): t;
-
Unmark marked files: [n]u;
-
Unmark all marked files: U
Navigate
-
Move cursor to previous folder: <; next foler: >;
-
Up one level: ^;
-
add file list of the subfolder on cursor at the end of the buffer: i;
** Jump to parent folder: C-M-p (jump to children folder is C-M-d, which is conflict with "Show desktop" shortcut of Mint);
** Jump to previous/next folder: C-M-p/C-M-n;
Manipulation
-
Copy: [n]C;
-
Delete: [n]d; delete with regex: %d;
-
Execute: x;
-
Create directory: +
-
Change mode (same as "chmod" command): M
-
Show file information (same as "file" command): y
-
Move or Rename: R;
** Use m then %u to rename file to upper case, while %l to lower case;
** move or rename with regex: %R;
-
View file: v (With Evil, if you want to quit reading file (v key) in Dired mode, use Q instead of q, because q is looked as the macro define key in Evil);
-
Run command on a file: mark it (with "m" key) and !
; In command , "*" means all marked files, "?" means execute command on files marked respectively; -
Compress files: mark files/directories, then "! zip file.zip *"; then use "g" to update display;
-
Compress/Uncompress one or more files to gz (orgin files will be replaced): Z;
-
Query-replace in selected files: mark files, then "Q";
-
Open file in another window (and focus that window): o;
-
Open file in another window (keep focus in Dired window): C-o;
-
Change ownership (same as "chown"): O;