This section describes the basic Dired commands to operate on one file or several files. All of these commands are capital letters; all of them use the minibuffer, either to read an argument or to ask for confirmation, before they act. All use the following convention to decide which files to manipulate:
Here are the file-manipulating commands that operate on files in this way. (Some other Dired commands, such as ! and the `%' commands, also use these conventions to decide which files to work on.)
dired-do-copy
). The argument new
is the directory to copy into, or (if copying a single file) the new
name.
If dired-copy-preserve-time
is non-nil
, then copying with
this command sets the modification time of the new file to be the same
as that of the old file.
dired-do-rename
). The argument
new is the directory to rename into, or (if renaming a single
file) the new name.
Dired automatically changes the visited file name of buffers associated
with renamed files so that they refer to the new names.
dired-do-hardlink
). The
argument new is the directory to make the links in, or (if making
just one link) the name to give the link.
dired-do-symlink
).
The argument new is the directory to make the links in, or (if
making just one link) the name to give the link.
dired-do-chmod
). This uses the chmod
program, so
modespec can be any argument that chmod
can handle.
dired-do-chgrp
).
dired-do-chown
). (On most systems, only the superuser can do
this.)
The variable dired-chown-program
specifies the name of the
program to use to do the work (different systems put chown
in
different places).
dired-do-print
). You must specify the
command to print them with, but the minibuffer starts out with a
suitable guess made using the variables lpr-command
and
lpr-switches
(the same variables that lpr-file
uses;
see section Hardcopy Output).
dired-do-compress
).
If the file appears to be a compressed file, it is uncompressed;
otherwise, it is compressed.
dired-do-load
).
See section Libraries of Lisp Code for Emacs.
dired-do-byte-compile
). See section `Byte Compilation' in The Emacs Lisp Reference Manual.
dired-do-search
).
This command is a variant of tags-search
. The search stops at
the first match it finds; use M-, to resume the search and find
the next match. See section Searching and Replacing with Tags Tables.
query-replace-regexp
on each of the specified files,
replacing matches for from (a regular expression) with the string
to (dired-do-query-replace
).
This command is a variant of tags-query-replace
. If you exit the
query replace loop, you can use M-, to resume the scan and replace
more matches. See section Searching and Replacing with Tags Tables.
One special file-operation command is +
(dired-create-directory
). This command reads a directory name and
creates the directory if it does not already exist.