Skip to Main Content
Learning GNU Emacs, 3rd Edition
book

Learning GNU Emacs, 3rd Edition

by Debra Cameron, James Elliott, Marc Loy, Eric S. Raymond, Bill Rosenblatt
December 2004
Beginner to intermediate content levelBeginner to intermediate
536 pages
19h 28m
English
O'Reilly Media, Inc.
Content preview from Learning GNU Emacs, 3rd Edition

Using Dired, the Directory Editor

Dired is one of the most interesting features of Emacs. With Dired, you can look at a listing of all the files in a directory, delete them, rename them, copy them, and perform almost all basic file operations. More important, Dired can make you more productive. For example, you can work with groups of files, deleting, moving, compressing, or even query-replacing strings in them.

There are several ways to start directory editing. If you're not in Emacs, invoke Emacs with a directory name as an argument, for example:

% emacs literature

Emacs starts up editing the directory literature: you'll see a single window that contains a listing of the literature directory. You can also start the directory editor by using C-x C-f (or any other command for visiting a file) and naming a directory, rather than a file. For example, typing C-x C-f literature gets you ready to edit the literature directory. Typing C-x d (for dired) or selecting the folder icon on the toolbar also starts Dired; you then specify a directory name. Finally, dragging a folder onto the Emacs window also starts Dired.[2]

No matter how you start the editor, the result is the same.

Type: C-x C-f literature Enter

image with no caption

A basic directory editor display.

As you can see, Dired's display is similar to what you see if you type ls -l at a Unix shell prompt. The permissions associated with the file, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning the vi and Vim Editors, 7th Edition

Learning the vi and Vim Editors, 7th Edition

Arnold Robbins, Elbert Hannah, Linda Lamb
Mastering Vim

Mastering Vim

Ruslan Osipov
Modern Vim

Modern Vim

Drew Neil

Publisher Resources

ISBN: 0596006489Supplemental ContentErrata Page