9.1.3 Find and inspect files with Dired

Dired is Emacs’s directory browser. Its ordinary listing is not document text: letters such as n, p and q invoke commands rather than being inserted. Emacsvox normally speaks filenames as you move, leaving detailed metadata for inspection on request. Voices and cues can distinguish directories, links and marked entries according to your presentation settings.

  1. Press C-x d, enter an existing directory such as ~/, and press RET. In the Dired buffer, press comma, ,, to hear the listing header.
  2. Move with n and p to the next or previous entry. To reach a known name in a long listing, use C-s, type part of the filename, and press RET to finish searching. Check the filename you reached before acting on it.
  3. On an ordinary file, press z to hear its size, lowercase c for its modification time, and / for permissions. These inspect the selected entry without opening it. Uppercase C is Dired’s Copy command, not a second way to hear the time. Size inspection on a directory instead uses the external du program and may take longer or be unavailable; file-type inspection with apostrophe, ', similarly requires the file program.
  4. Press RET on the file to visit it in Emacs. On a directory, RET opens that directory’s listing. Opening announces the destination; C-e m lets you check the resulting buffer and mode. Use RET here, not C-j: Emacsvox assigns C-j and Control-Enter to a separate, file-type-aware opener which may preview or play a file instead of visiting its text.
  5. To return from the document, use C-x b and select the directory buffer. In Dired, ^ goes to the parent directory and g refreshes the listing from disk. Refreshing Dired does not save or discard an open document’s edits. Press q in Dired to leave the listing; your files remain on disk.

Looking at a file is not the same as marking it for an operation. m marks an entry and then moves to the next; its action cue precedes the newly selected filename. u unmarks an entry and also advances. If you are inspecting a listing with existing marks, leave them alone. Dired operations can apply to marked files rather than the row you are hearing.

This guide does not require deletion, renaming, changing permissions or running commands on files. In particular, d flags deletion and x executes flagged deletions; do not use either as a way to close a listing. Cancellation after a file operation and ordinary text undo are not promises of filesystem recovery. Use Dired in the GNU Emacs Manual before performing those operations, and emacsvox-dired for the complete speech-command reference.