Skip to content

Emacs Shortcuts for dired

Description Shortcut
Fuzzy find file with fd, (Doom Emacs) +vertico/consult-fd-or-find
Find a file with pattern, case sensitive (like Linux) find-name-dired <pattern like *string*>
Find a file with pattern, case insensitive or other flags find-dired and set flags as needed
Grep in directory, by default does not include hidden consult-rg or counsel-rg
Grep in version controlled files in git consult-rg or counsel-git-grep
  • Use find-name-dired to search for files recursively in a directory
    • Use * as a wild card, the search is case sensitive
  • or use find-dired and use flag -iname to search case insensitive and/or other find flags
  • Use wdired-change-to-wdired-mode or C-c C-e to edit the results in dired and apply with C-c
  • Use browse-url-of-dired-file to open the file in the browser or default OS program like on Windows
  • Grep in directory and got to search results using projectile-ripgrep
    • e to edit results
    • m for rg-menu for ripgrep options like search hidden files with --hidden
    • query-replace or M-% to make changes
    • apply changes with C-x C-s to save or C-c C-k to abort
Description Shortcut
Grep in directory grep
Grep in directory, change search results grep and search, C-c C-p or wgrep-change-to-wgrep-mode
Grep in directory, change search results save or abort C-x C-s (save) or C-c C-k
Name Shortcuts
Open dired C-x d
Open dired in directory with point on current file C-x C-j
Rename current file (Emacs 29+) rename-visited-file
Find file and open or create file C-x C-f
Make Directory +

For renaming files under version control, dired will rename them in a friendly way, for example using git mv. This functionality is controlled by the variable dired-vc-rename-file being t (true).

Name Shortcuts
Mark file m
Unmark file u
Unmark all files U
Mark all files in directory * s
Invert marks in buffer * t, t
Mark using RegExp % m

from Emacs: store music playlists (Dired+Bongo) - YouTube |

Name Shortcuts
Copy path and file names of marked items C-0 w
Copy file name at point w
Name Shortcuts
Compress file c
Copy file S-c
Copy filename at point or marked C-0 w
Delete - delete file at point with confirmation S-d
Delete - Execute deletion of marks x
Delete - Mark for deletion d
Execute program on file (e.g. cat) ! or &
Move/rename file, respect VCS like git mv (move) S-r , dired-do-rename
Open, Edit file RET
Open file in other window o
Open file in other window without focusing on it M-o/RET
Open with External Program dired-do-open or S-w
Open with local browser browse-url-of-dired-file, S-w
Preview file g o and close with q
Rename based on RegExp % R
Wdired dired, make dired buffer editable C-c C-e
Name Shortcuts
Touch (change timestamp of file) T
Change file mode M
Change file owner O
Change file group G
Name Shortcuts
Go up one directory ^
Create directory +
Create symbolic link S
Name Shortcuts
Compress/uncompress Z
Load Emacs Lisp (.el) file into Emacs L
Show/hide/view permission, user, group, space details using dired-hide-details-mode (