Exploring the Depths of Dired


Let’s dive into Dired!

Dired is truly one of the great features of Emacs, but it can be hard to adopt at first because the interface is pretty bland and unhelpful.

However, I believe that this package is worth learning deeply because it can make many file and directory operations much more efficient!

Today we’re going to dive to the depths of Dired via the manual and the information we can find in the functions and variables it provides in Emacs.

We won’t cover visual customization specifically, this is more about Dired functionality!


Things to try:

  • File marking, especially using patterns
  • dired-jump
  • Image thumbnails
  • Cleaning up folders with ~
  • Running shell commands on files
  • Comparing files between directories
  • Bulk file content changes with Q (query-replace-regexp)
  • Using wdired mode
  • Investigating dired-x

Any other suggestions?


(setq dired-dwim-target t) to automatically pick the right target for copy/move operations based on another open Dired window.

Interesting bindings under %:

% &             dired-flag-garbage-files
% C             dired-do-copy-regexp
% R             dired-do-rename-regexp
% d             dired-flag-files-regexp
% g             dired-mark-files-containing-regexp
% m             dired-mark-files-regexp
% r             dired-do-rename-regexp

Renaming files with a regular expression:

C-x C-q then C-M-%, enter a regular expression like \(.*\)-\([[:digit:]]\{4\}\) → \2-\1

How does Dirvish work?

Dirvish is a really elaborate package that builds on Dired to provide a polished experience! How do they do it?


Subscribe to the System Crafters Newsletter!
Stay up to date with the latest System Crafters news and updates! Read the Newsletter page for more information.
Name (optional)
Email Address