Batch-edit file permissions in dired

I’ve written before about using the editing features in dired (AKA wdired) to do neat things like redirect symlinks. I recently discovered that by adding the following option to your emacs config file:

;; allow editing file permissions
(setq wdired-allow-to-change-permissions t)

then you can also edit the file permissions directly in the dired buffer.

Here’s a quick animated example where I want to set group write permissions for all the pdf files in a particular directory. I use several tools to make this really easy:

  1. I used dired-narrow to filter the view down to just the pdf files
  2. I use C-x C-q to make the dired buffer editable
  3. I move to the group write permission spot on the first line and then use multiple cursors to add a cursor for each line
  4. I hit w to set the write permission, RET to quit multiple cursors, and C-c C-c to make the change permanent

dired-file-permissions.gif