08 August 2026 Saturday
Up at 8
Dired
another question abotu workflow I often want to see all the mp4s in a directory tree. eg ls ~/path/*/*mp4 this searches multiple sub dirs. can I do this in dired/emacs ?
⏺ Yes — two good ways, depending on whether you want a fixed depth or full recursion:
Exact glob, like your ls example: C-x d (dired) accepts wildcards in the path:
C-x d ~/path/*/*.mp4 RET
Emacs hands the pattern to the shell, so it behaves exactly like your ls — one level of subdirs, mp4s only, collected into a single dired buffer.
Full recursion, any depth — M-x find-name-dired:
M-x find-name-dired RET ~/path RET *.mp4 RET
That runs find underneath and streams every match in the whole tree into a dired buffer, each line showing its relative path. Its sibling find-dired takes raw find args when you want more — e.g. -name '*.mp4' -mtime -7 for videos newer than a week, or -size +500M.
The important part: both give you a real dired buffer — so RET on a hit launches VLC via the dired-open mapping we just added, t marks everything for a batch operation, Q query-replaces across them, C copies them somewhere, etc. Your whole dired toolkit works on search results.
One tip for the find-dired buffers: they're sorted in find discovery order; press s there and Emacs will complain it can't re-sort — if you want sorted output, C-u s and it re-lists with switches applied where possible, or just use the glob form which sorts like ls.