Skip to content

Emacs Shortcuts for dired

DescriptionShortcut
Find a file with pattern, case sensitive (like Linux)find-name-dired <pattern like *string*>
Grep in directory, by default does not include hiddenconsult-rg or counsel-rg
Grep in version controlled files in gitconsult-rg or counsel-git-grep
  • 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
DescriptionShortcut
Grep in directorygrep
Grep in directory, change search resultsgrep and search, C-c C-p or wgrep-change-to-wgrep-mode
Grep in directory, change search results save or abortC-x C-s (save) or C-c C-k
NameShortcuts
Open diredC-x d
Rename current file (Emacs 29+)rename-visited-file
Find file and open or create fileC-x C-f
Make Directory+
NameShortcuts
Mark filem
Unmark fileu
Unmark all filesU
Mark all files in directory* s
Invert marks in buffer * t, t
Mark using RegExp% m

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

NameShortcuts
Copy path and file names of marked itemsC-0 w
Copy file name at pointw
NameShortcuts
Open, Edit fileRET
Open with local browserbrowse-url-of-dired-file, W
Copy fileC
Move/rename fileR
Rename based on RegExp% R
Delete - D
Delete - Mark for deletion d
Delete - Execute deletion of marksx
Open fileRET
Open file in other windowo
Open file in other window without focusing on itAlt-o/RET
Preview fileg o and close with q
Execute program on file (e.g. cat)! or &
Copy filename at point or markedC-0 w
NameShortcuts
Touch (change timestamp of file)T
Change file modeM
Change file ownerO
Change file groupG
NameShortcuts
Go up one directory^
Create directory+
Create symbolic linkS
NameShortcuts
Compress/uncompressZ
Load Emacs Lisp (.el) file into EmacsL
Show/hide/view permission, user, group, space details using dired-hide-details-mode(