EmacsWiki: Dired Mode (original) (raw)
Dired is the main mode for Emacs file-manager operations. The name “Dired” stands for “directory editor”.
A single Dired buffer can display the contents of a single directory, or it can include listings of one or more sub-directories. A Dired buffer can alternatively display an arbitrary set of files and directories, from any file systems.
A Dired buffer can display a filtered subset of directory contents, and it can show either just file names or additional file details.
All the operations you expect from a typical file-manager application are available in Dired, plus some that are specific to Emacs.
You can use ‘C-x C-q’
to make a Dired buffer editable. This enters WDired mode (writable Dired). For example, you can use this to bulk-rename files, or to change file ownerships and privileges.
You can operate on multiple files after marking them. The usual mark is ‘*’
, but the mark used for deletion is ‘D’
. ‘D’
marks are also called flags, and the operation of marking with ‘D’
is also called flagging.
You visit a directory in Dired mode using key bindings ‘C-x d’
, ‘C-x 4 d’
, and ‘C-x 5 d’
.
The menu bar is helpful for learning operations and key bindings. As always, ‘C-h m’
provides information on the mode. Consult the Emacs manual (‘C-h r’
) for more info – choose Dired under Advanced Features. You can also read about Dired online.)
Dired as Distributed with Gnu Emacs
- Dired X – standard library
dired-x.el
. - DiredOmitMode – Selectively remove files and subdirectories from the display, to reduce clutter.
- Dired Aux – library
dired-aux.el
. - WDired – Edit a Dired buffer.
- Image Dired Thumbnail Mode – Use listings of image files
- DiredSearchAndReplace – Search multiple files.
Some Tips and Features
- DiredFindFileOtherFrame – open a new frame from dired
- DiredFindInLisp – Run
‘find-dired’
and‘find-grep-dired’
with only Emacs Lisp code. - DiredGetFileSize – File size of selected files
- DiredLineCommands – Improvements to next and previous line in Dired.
- DiredPower – Various Dired tips and features.
- DiredOfFile – Open Dired for current file only
- DiredReuseDirectoryBuffer – Make Dired reuse an existing Dired buffer
- DiredSorting – Dired tips and addons for sorting listings
- DiredSortCriterias – minimalistic dired sorting by different criterias This page provides supplementary information about DiredMode and some enhancements to it.
- ExecuteSomeDiredCommand – Execute Command whose Name Contains
‘dired’
- FindGrepDiredDoSearch – logical combination of find-grep-dired and dired-do-search
- FindGrepDiredSearchAndReplace – interactive regexp search/replace in, say “*.rb” in current dir and all subdirs.
3rd-Party Packages That Provide Dired Features
- Bookmark+
- In the bookmark list, `
M-d >
’ opens Dired on the marked file and directory bookmarks (only). - In Dired,
‘C-j’
jumps among different “views” or states of the same Dired buffer. - You can bookmark any Dired buffer – its current state. Jump among Dired bookmarks using
‘J’
in Dired (or‘C-x j d’
globally). - In Dired,
‘M-b’
bookmarks each of the marked files and dirs.
- In the bookmark list, `
- Dired+ – Extends standard Emacs libraries
dired.el
,dired-aux.el
, anddired-x.el
in many ways. (see also: DiredPlus) - DiredBookmarks – Save/restore Dired state persistently, including switches, marked files, inserted subdirectories, and hidden (sub)directories.
- diredc – Dual-pane Dired with many Midnight Commander features, and more.
- DiredDetails – Hide or show file and directory details in a Dired listing. When details are hidden, all you see (and all IncrementalSearch sees) are the file names.
- DiMode – Simple directory editor for GNU Emacs, by JoeKeane.
- DiredDragAndDrop – Drag-and-drop files.
- DiredEfap – Rename the file at point in Dired.
- DiredFileTypeFaces – Colorful file names in Dired buffers.
- Diredful – Colorful file names in Dired buffers.
- dired-hacks – Collection of Dired packages that add filtering, subtrees, intelligent file opening,
‘avfs’
support, coloring and more. - DiredSync – Synchronize directories within Dired.
- DiredView – Browse and select files using the first character of their names.
- dired-icon – Display file icons in Dired buffers.
- dired-toggle.el – A simple way to toggle Dired buffer for current directory, similar to
‘dired-jump’
(‘C-x C-j’
) - dired-visit-history.el – Add Dired visits to
‘file-name-history’
. - Files+ – (see also: FilesPlus)
- Integrates
‘find-file’
(‘C-x C-f’
) and related commands with Dired - Together with ls-lisp+.el, modifies
‘insert-directory’
so that Dired’s second header line lists the number of files:files 691
space used 49439 available 56233408
- Integrates
- `grep' the marked files
- Icicles - Dired Enhancements – minibuffer regexp completion and completion-candidate cycling to navigate directories and perform operations on files
- Search-and-replace on the marked files.
- Save marked file names as completion candidates for later reuse.
- Open Dired on saved file names (`
C-M-<
’), that is, names that you previously saved as an Emacs fileset or as an Icicles completion candidates set.
- Isearch
- DiredIsearch – Run
‘isearch’
in Dired, but match only file names - DiredLis – Letter
‘isearch’
in Dired mode, no need to use keys to activate‘isearch-mode’
.
- DiredIsearch – Run
- MidnightCommanderMode – Emulates Midnight Commander.
- NortonCommanderMode – Emulates Norton Commander.
- OperatingOnFilesInDired – Open files using associated applications.
- Sunrise Commander – Midnight Commander clone (github).
- ThumbsMode – Automatic image previewing.
- Trashcan – A recoverable file-deletion system that behaves like the trash can or recycle bin of many operating systems.
- Virtual Dired – Edit text files that list files as if they were directory listings.
MS Windows Tips and Features For Dired
- DiredWThirtyTwoTweaks – Dired Enhancements for MS Windows
- MsShellExecute – Open files from Dired on MS Windows
- WThirtyTwoFindDired – Lightweight MS Windows-specific version of
‘find-dired’
.
See also
- CategoryDirectories for some other listing formats, besides what you get in Dired.
- DiredModeScreenshots - Here are some screenshots of Dired buffers, vanilla and otherwise.
- IbufferMode lets you control your buffers in a dired-like fashion.
CategoryDirectories CategoryFiles CategoryModes CategoryProgrammerUtils