The essential Mickey over at Mastering Emacs has another post in his series on dired
. This time it’s about running shell commands on multiple files from within Emacs. If you’re a Unix user and used to using find
and xargs
to do this sort of thing, you should definitely check out Mickey’s post. Using dired
is easier and you don’t have to leave Emacs or even bring up a shell of some sort in a buffer. Unless you’re a dired
expert, Mickey’s post will teach you things you didn’t know. And while you’re there, be sure to follow the link to his post on how to work with files spread out across many directories. The two posts tell you pretty much everything you need to know to use dired
in situations that would otherwise require find
and xargs
.
If you’re like me, you probably started using dired
as a convenient way of listing files so you could pick one to load into a buffer. Later, maybe, you started doing simple operations like deleting a file or perhaps renaming it. It’s when you first realize that you can work on multiple files at the same time that you begin to realize how powerful dired
is. For example, watch Magnar Sveen use multiple-cursors to change file names in a writable dired buffer. Of course you can do this using dired
commands too but it shows how flexible dired
is and how it can adapt to your way of working. Mickey’s post shows how you can apply external commands to multiple files in a variety of ways. Very useful information.