comparison man/dired.texi @ 35056:c9c43bb7f1d2

Add index entries for many Dired commands and features.
author Eli Zaretskii <eliz@gnu.org>
date Thu, 04 Jan 2001 17:47:11 +0000
parents 79e9f560240d
children a1ff91eda21c
comparison
equal deleted inserted replaced
35055:daf01616a3e7 35056:c9c43bb7f1d2
3 @c Free Software Foundation, Inc. 3 @c Free Software Foundation, Inc.
4 @c See file emacs.texi for copying conditions. 4 @c See file emacs.texi for copying conditions.
5 @node Dired, Calendar/Diary, Rmail, Top 5 @node Dired, Calendar/Diary, Rmail, Top
6 @chapter Dired, the Directory Editor 6 @chapter Dired, the Directory Editor
7 @cindex Dired 7 @cindex Dired
8 @cindex file management
8 9
9 Dired makes an Emacs buffer containing a listing of a directory, and 10 Dired makes an Emacs buffer containing a listing of a directory, and
10 optionally some of its subdirectories as well. You can use the normal 11 optionally some of its subdirectories as well. You can use the normal
11 Emacs commands to move around in this buffer, and special Dired commands 12 Emacs commands to move around in this buffer, and special Dired commands
12 to operate on the files listed. 13 to operate on the files listed.
136 return immediately to Dired, with the deletion flags still present in 137 return immediately to Dired, with the deletion flags still present in
137 the buffer, and no files actually deleted. 138 the buffer, and no files actually deleted.
138 139
139 @node Flagging Many Files 140 @node Flagging Many Files
140 @section Flagging Many Files at Once 141 @section Flagging Many Files at Once
142 @cindex flagging many files for deletion (in Dired)
141 143
142 @table @kbd 144 @table @kbd
143 @item # 145 @item #
144 Flag all auto-save files (files whose names start and end with @samp{#}) 146 Flag all auto-save files (files whose names start and end with @samp{#})
145 for deletion (@pxref{Auto Save}). 147 for deletion (@pxref{Auto Save}).
169 keep.@refill 171 keep.@refill
170 172
171 @kindex & @r{(Dired)} 173 @kindex & @r{(Dired)}
172 @findex dired-flag-garbage-files 174 @findex dired-flag-garbage-files
173 @vindex dired-garbage-files-regexp 175 @vindex dired-garbage-files-regexp
176 @cindex deleting some backup files
174 @kbd{&} (@code{dired-flag-garbage-files}) flags files whose names 177 @kbd{&} (@code{dired-flag-garbage-files}) flags files whose names
175 match the regular expression specified by the variable 178 match the regular expression specified by the variable
176 @code{dired-garbage-files-regexp}. By default, this matches certain 179 @code{dired-garbage-files-regexp}. By default, this matches certain
177 files produced by @TeX{}, and the @samp{.orig} and @samp{.rej} files 180 files produced by @TeX{}, and the @samp{.orig} and @samp{.rej} files
178 produced by @code{patch}. 181 produced by @code{patch}.
179 182
180 @kindex # @r{(Dired)} 183 @kindex # @r{(Dired)}
181 @kindex ~ @r{(Dired)} 184 @kindex ~ @r{(Dired)}
182 @findex dired-flag-auto-save-files 185 @findex dired-flag-auto-save-files
183 @findex dired-flag-backup-files 186 @findex dired-flag-backup-files
187 @cindex deleting auto-save files
184 @kbd{#} (@code{dired-flag-auto-save-files}) flags for deletion all 188 @kbd{#} (@code{dired-flag-auto-save-files}) flags for deletion all
185 files whose names look like auto-save files (@pxref{Auto Save})---that 189 files whose names look like auto-save files (@pxref{Auto Save})---that
186 is, files whose names begin and end with @samp{#}. @kbd{~} 190 is, files whose names begin and end with @samp{#}. @kbd{~}
187 (@code{dired-flag-backup-files}) flags for deletion all files whose 191 (@code{dired-flag-backup-files}) flags for deletion all files whose
188 names say they are backup files (@pxref{Backup})---that is, whose names 192 names say they are backup files (@pxref{Backup})---that is, whose names
270 @end table 274 @end table
271 275
272 @node Marks vs Flags 276 @node Marks vs Flags
273 @section Dired Marks vs. Flags 277 @section Dired Marks vs. Flags
274 278
275 @cindex marking in Dired 279 @cindex marking many files (in Dired)
276 Instead of flagging a file with @samp{D}, you can @dfn{mark} the file 280 Instead of flagging a file with @samp{D}, you can @dfn{mark} the file
277 with some other character (usually @samp{*}). Most Dired commands to 281 with some other character (usually @samp{*}). Most Dired commands to
278 operate on files, aside from ``expunge'' (@kbd{x}), look for files 282 operate on files, aside from ``expunge'' (@kbd{x}), look for files
279 marked with @samp{*}. 283 marked with @samp{*}.
280 284
294 files.) 298 files.)
295 299
296 @item * * 300 @item * *
297 @kindex * * @r{(Dired)} 301 @kindex * * @r{(Dired)}
298 @findex dired-mark-executables 302 @findex dired-mark-executables
303 @cindex marking executable files (in Dired)
299 Mark all executable files with @samp{*} 304 Mark all executable files with @samp{*}
300 (@code{dired-mark-executables}). With a numeric argument, unmark all 305 (@code{dired-mark-executables}). With a numeric argument, unmark all
301 those files. 306 those files.
302 307
303 @item * @@ 308 @item * @@
304 @kindex * @@ @r{(Dired)} 309 @kindex * @@ @r{(Dired)}
305 @findex dired-mark-symlinks 310 @findex dired-mark-symlinks
311 @cindex marking symlinks (in Dired)
306 Mark all symbolic links with @samp{*} (@code{dired-mark-symlinks}). 312 Mark all symbolic links with @samp{*} (@code{dired-mark-symlinks}).
307 With a numeric argument, unmark all those files. 313 With a numeric argument, unmark all those files.
308 314
309 @item * / 315 @item * /
310 @kindex * / @r{(Dired)} 316 @kindex * / @r{(Dired)}
311 @findex dired-mark-directories 317 @findex dired-mark-directories
318 @cindex marking subdirectories (in Dired)
312 Mark with @samp{*} all files which are actually directories, except for 319 Mark with @samp{*} all files which are actually directories, except for
313 @file{.} and @file{..} (@code{dired-mark-directories}). With a numeric 320 @file{.} and @file{..} (@code{dired-mark-directories}). With a numeric
314 argument, unmark all those files. 321 argument, unmark all those files.
315 322
316 @item * s 323 @item * s
328 335
329 @item @key{DEL} 336 @item @key{DEL}
330 @itemx * @key{DEL} 337 @itemx * @key{DEL}
331 @kindex * DEL @r{(Dired)} 338 @kindex * DEL @r{(Dired)}
332 @findex dired-unmark-backward 339 @findex dired-unmark-backward
340 @cindex unmarking files (in Dired)
333 Move point to previous line and remove any mark on that line 341 Move point to previous line and remove any mark on that line
334 (@code{dired-unmark-backward}). 342 (@code{dired-unmark-backward}).
335 343
336 @item * ! 344 @item * !
337 @kindex * ! @r{(Dired)} 345 @kindex * ! @r{(Dired)}
363 Move up to the previous marked file (@code{dired-prev-marked-file}) 371 Move up to the previous marked file (@code{dired-prev-marked-file})
364 372
365 @item * t 373 @item * t
366 @kindex * t @r{(Dired)} 374 @kindex * t @r{(Dired)}
367 @findex dired-do-toggle 375 @findex dired-do-toggle
376 @cindex toggling marks (in Dired)
368 Toggle all marks (@code{dired-do-toggle}): files marked with @samp{*} 377 Toggle all marks (@code{dired-do-toggle}): files marked with @samp{*}
369 become unmarked, and unmarked files are marked with @samp{*}. Files 378 become unmarked, and unmarked files are marked with @samp{*}. Files
370 marked in any other way are not affected. 379 marked in any other way are not affected.
371 380
372 @item * c @var{old} @var{new} 381 @item * c @var{old} @var{new}
407 @samp{^} and @samp{$} to anchor matches. Exclude subdirectories by 416 @samp{^} and @samp{$} to anchor matches. Exclude subdirectories by
408 hiding them (@pxref{Hiding Subdirectories}). 417 hiding them (@pxref{Hiding Subdirectories}).
409 418
410 @item % g @var{regexp} @key{RET} 419 @item % g @var{regexp} @key{RET}
411 @findex dired-mark-files-containing-regexp 420 @findex dired-mark-files-containing-regexp
412 @kindex % m @r{(Dired)} 421 @kindex % g @r{(Dired)}
422 @cindex finding files containing regexp matches (in Dired)
413 Mark (with @samp{*}) all files whose @emph{contents} contain a match for 423 Mark (with @samp{*}) all files whose @emph{contents} contain a match for
414 the regular expression @var{regexp} 424 the regular expression @var{regexp}
415 (@code{dired-mark-files-containing-regexp}). This command is like 425 (@code{dired-mark-files-containing-regexp}). This command is like
416 @kbd{% m}, except that it searches the file contents instead of the file 426 @kbd{% m}, except that it searches the file contents instead of the file
417 name. 427 name.
453 commands, also use these conventions to decide which files to work on.) 463 commands, also use these conventions to decide which files to work on.)
454 464
455 @table @kbd 465 @table @kbd
456 @findex dired-do-copy 466 @findex dired-do-copy
457 @kindex C @r{(Dired)} 467 @kindex C @r{(Dired)}
468 @cindex copying files (in Dired)
458 @item C @var{new} @key{RET} 469 @item C @var{new} @key{RET}
459 Copy the specified files (@code{dired-do-copy}). The argument @var{new} 470 Copy the specified files (@code{dired-do-copy}). The argument @var{new}
460 is the directory to copy into, or (if copying a single file) the new 471 is the directory to copy into, or (if copying a single file) the new
461 name. 472 name.
462 @vindex dired-recursive-copies 473 @vindex dired-recursive-copies
476 files, or the next @var{n} files. By contrast, @kbd{x} 487 files, or the next @var{n} files. By contrast, @kbd{x}
477 (@code{dired-expunge}) deletes all @dfn{flagged} files. 488 (@code{dired-expunge}) deletes all @dfn{flagged} files.
478 489
479 @findex dired-do-rename 490 @findex dired-do-rename
480 @kindex R @r{(Dired)} 491 @kindex R @r{(Dired)}
492 @cindex renaming files (in Dired)
481 @item R @var{new} @key{RET} 493 @item R @var{new} @key{RET}
482 Rename the specified files (@code{dired-do-rename}). The argument 494 Rename the specified files (@code{dired-do-rename}). The argument
483 @var{new} is the directory to rename into, or (if renaming a single 495 @var{new} is the directory to rename into, or (if renaming a single
484 file) the new name. 496 file) the new name.
485 497
486 Dired automatically changes the visited file name of buffers associated 498 Dired automatically changes the visited file name of buffers associated
487 with renamed files so that they refer to the new names. 499 with renamed files so that they refer to the new names.
488 500
489 @findex dired-do-hardlink 501 @findex dired-do-hardlink
490 @kindex H @r{(Dired)} 502 @kindex H @r{(Dired)}
503 @cindex hard links (in Dired)
491 @item H @var{new} @key{RET} 504 @item H @var{new} @key{RET}
492 Make hard links to the specified files (@code{dired-do-hardlink}). The 505 Make hard links to the specified files (@code{dired-do-hardlink}). The
493 argument @var{new} is the directory to make the links in, or (if making 506 argument @var{new} is the directory to make the links in, or (if making
494 just one link) the name to give the link. 507 just one link) the name to give the link.
495 508
496 @findex dired-do-symlink 509 @findex dired-do-symlink
497 @kindex S @r{(Dired)} 510 @kindex S @r{(Dired)}
511 @cindex symlinks (in Dired)
498 @item S @var{new} @key{RET} 512 @item S @var{new} @key{RET}
499 Make symbolic links to the specified files (@code{dired-do-symlink}). 513 Make symbolic links to the specified files (@code{dired-do-symlink}).
500 The argument @var{new} is the directory to make the links in, or (if 514 The argument @var{new} is the directory to make the links in, or (if
501 making just one link) the name to give the link. 515 making just one link) the name to give the link.
502 516
503 @findex dired-do-chmod 517 @findex dired-do-chmod
504 @kindex M @r{(Dired)} 518 @kindex M @r{(Dired)}
519 @cindex changing file permissions (in Dired)
505 @item M @var{modespec} @key{RET} 520 @item M @var{modespec} @key{RET}
506 Change the mode (also called ``permission bits'') of the specified files 521 Change the mode (also called ``permission bits'') of the specified files
507 (@code{dired-do-chmod}). This uses the @code{chmod} program, so 522 (@code{dired-do-chmod}). This uses the @code{chmod} program, so
508 @var{modespec} can be any argument that @code{chmod} can handle. 523 @var{modespec} can be any argument that @code{chmod} can handle.
509 524
510 @findex dired-do-chgrp 525 @findex dired-do-chgrp
511 @kindex G @r{(Dired)} 526 @kindex G @r{(Dired)}
527 @cindex changing file group ownership (in Dired)
512 @item G @var{newgroup} @key{RET} 528 @item G @var{newgroup} @key{RET}
513 Change the group of the specified files to @var{newgroup} 529 Change the group of the specified files to @var{newgroup}
514 (@code{dired-do-chgrp}). 530 (@code{dired-do-chgrp}).
515 531
516 @findex dired-do-chown 532 @findex dired-do-chown
517 @kindex O @r{(Dired)} 533 @kindex O @r{(Dired)}
534 @cindex changing file owner (in Dired)
518 @item O @var{newowner} @key{RET} 535 @item O @var{newowner} @key{RET}
519 Change the owner of the specified files to @var{newowner} 536 Change the owner of the specified files to @var{newowner}
520 (@code{dired-do-chown}). (On most systems, only the superuser can do 537 (@code{dired-do-chown}). (On most systems, only the superuser can do
521 this.) 538 this.)
522 539
525 program to use to do the work (different systems put @code{chown} in 542 program to use to do the work (different systems put @code{chown} in
526 different places). 543 different places).
527 544
528 @findex dired-do-print 545 @findex dired-do-print
529 @kindex P @r{(Dired)} 546 @kindex P @r{(Dired)}
547 @cindex printing files (in Dired)
530 @item P @var{command} @key{RET} 548 @item P @var{command} @key{RET}
531 Print the specified files (@code{dired-do-print}). You must specify the 549 Print the specified files (@code{dired-do-print}). You must specify the
532 command to print them with, but the minibuffer starts out with a 550 command to print them with, but the minibuffer starts out with a
533 suitable guess made using the variables @code{lpr-command} and 551 suitable guess made using the variables @code{lpr-command} and
534 @code{lpr-switches} (the same variables that @code{lpr-buffer} uses; 552 @code{lpr-switches} (the same variables that @code{lpr-buffer} uses;
535 @pxref{Hardcopy}). 553 @pxref{Hardcopy}).
536 554
537 @findex dired-do-compress 555 @findex dired-do-compress
538 @kindex Z @r{(Dired)} 556 @kindex Z @r{(Dired)}
557 @cindex compressing files (in Dired)
539 @item Z 558 @item Z
540 Compress the specified files (@code{dired-do-compress}). If the file 559 Compress the specified files (@code{dired-do-compress}). If the file
541 appears to be a compressed file already, it is uncompressed instead. 560 appears to be a compressed file already, it is uncompressed instead.
542 561
543 @findex dired-do-load 562 @findex dired-do-load
544 @kindex L @r{(Dired)} 563 @kindex L @r{(Dired)}
564 @cindex loading several files (in Dired)
545 @item L 565 @item L
546 Load the specified Emacs Lisp files (@code{dired-do-load}). 566 Load the specified Emacs Lisp files (@code{dired-do-load}).
547 @xref{Lisp Libraries}. 567 @xref{Lisp Libraries}.
548 568
549 @findex dired-do-byte-compile 569 @findex dired-do-byte-compile
550 @kindex B @r{(Dired)} 570 @kindex B @r{(Dired)}
571 @cindex byte-compiling several files (in Dired)
551 @item B 572 @item B
552 Byte compile the specified Emacs Lisp files 573 Byte compile the specified Emacs Lisp files
553 (@code{dired-do-byte-compile}). @xref{Byte Compilation,, Byte 574 (@code{dired-do-byte-compile}). @xref{Byte Compilation,, Byte
554 Compilation, elisp, The Emacs Lisp Reference Manual}. 575 Compilation, elisp, The Emacs Lisp Reference Manual}.
555 576
556 @kindex A @r{(Dired)} 577 @kindex A @r{(Dired)}
557 @findex dired-do-search 578 @findex dired-do-search
579 @cindex search multiple files (in Dired)
558 @item A @var{regexp} @key{RET} 580 @item A @var{regexp} @key{RET}
559 Search all the specified files for the regular expression @var{regexp} 581 Search all the specified files for the regular expression @var{regexp}
560 (@code{dired-do-search}). 582 (@code{dired-do-search}).
561 583
562 This command is a variant of @code{tags-search}. The search stops at 584 This command is a variant of @code{tags-search}. The search stops at
563 the first match it finds; use @kbd{M-,} to resume the search and find 585 the first match it finds; use @kbd{M-,} to resume the search and find
564 the next match. @xref{Tags Search}. 586 the next match. @xref{Tags Search}.
565 587
566 @kindex Q @r{(Dired)} 588 @kindex Q @r{(Dired)}
567 @findex dired-do-query-replace 589 @findex dired-do-query-replace
590 @cindex search and replace in multiple files (in Dired)
568 @item Q @var{from} @key{RET} @var{to} @key{RET} 591 @item Q @var{from} @key{RET} @var{to} @key{RET}
569 Perform @code{query-replace-regexp} on each of the specified files, 592 Perform @code{query-replace-regexp} on each of the specified files,
570 replacing matches for @var{from} (a regular expression) with the string 593 replacing matches for @var{from} (a regular expression) with the string
571 @var{to} (@code{dired-do-query-replace}). 594 @var{to} (@code{dired-do-query-replace}).
572 595
574 query replace loop, you can use @kbd{M-,} to resume the scan and replace 597 query replace loop, you can use @kbd{M-,} to resume the scan and replace
575 more matches. @xref{Tags Search}. 598 more matches. @xref{Tags Search}.
576 599
577 @kindex a @r{(Dired)} 600 @kindex a @r{(Dired)}
578 @findex dired-do-apply 601 @findex dired-do-apply
602 @cindex apply arbitrary function to many files
579 @item a @var{function} @kbd{RET} 603 @item a @var{function} @kbd{RET}
580 Apply an arbitrary Lisp function to the name of each marked file 604 Apply an arbitrary Lisp function to the name of each marked file
581 (@code{dired-do-apply}). 605 (@code{dired-do-apply}).
582 @end table 606 @end table
583 607
646 Here are commands that alter file names in a systematic way: 670 Here are commands that alter file names in a systematic way:
647 671
648 @table @kbd 672 @table @kbd
649 @findex dired-upcase 673 @findex dired-upcase
650 @kindex % u @r{(Dired)} 674 @kindex % u @r{(Dired)}
675 @cindex upcase file names
651 @item % u 676 @item % u
652 Rename each of the selected files to an upper-case name 677 Rename each of the selected files to an upper-case name
653 (@code{dired-upcase}). If the old file names are @file{Foo} 678 (@code{dired-upcase}). If the old file names are @file{Foo}
654 and @file{bar}, the new names are @file{FOO} and @file{BAR}. 679 and @file{bar}, the new names are @file{FOO} and @file{BAR}.
655 680
656 @item % l 681 @item % l
657 @findex dired-downcase 682 @findex dired-downcase
658 @kindex % l @r{(Dired)} 683 @kindex % l @r{(Dired)}
684 @cindex downcase file names
659 Rename each of the selected files to a lower-case name 685 Rename each of the selected files to a lower-case name
660 (@code{dired-downcase}). If the old file names are @file{Foo} and 686 (@code{dired-downcase}). If the old file names are @file{Foo} and
661 @file{bar}, the new names are @file{foo} and @file{bar}. 687 @file{bar}, the new names are @file{foo} and @file{bar}.
662 688
663 @item % R @var{from} @key{RET} @var{to} @key{RET} 689 @item % R @var{from} @key{RET} @var{to} @key{RET}
708 this easier, the @kbd{%} commands to operate on files use the last 734 this easier, the @kbd{%} commands to operate on files use the last
709 regular expression specified in any @kbd{%} command as a default. 735 regular expression specified in any @kbd{%} command as a default.
710 736
711 @node Comparison in Dired 737 @node Comparison in Dired
712 @section File Comparison with Dired 738 @section File Comparison with Dired
739 @cindex file comparison (in Dired)
740 @cindex compare files (in Dired)
713 741
714 Here are two Dired commands that compare specified files using 742 Here are two Dired commands that compare specified files using
715 @code{diff}. 743 @code{diff}.
716 744
717 @table @kbd 745 @table @kbd
862 The subdirectory hiding commands toggle; that is, they hide what was 890 The subdirectory hiding commands toggle; that is, they hide what was
863 visible, and show what was hidden. 891 visible, and show what was hidden.
864 892
865 @node Dired Updating 893 @node Dired Updating
866 @section Updating the Dired Buffer 894 @section Updating the Dired Buffer
895 @cindex updating Dired buffer
896 @cindex refreshing displayed files
867 897
868 This section describes commands to update the Dired buffer to reflect 898 This section describes commands to update the Dired buffer to reflect
869 outside (non-Dired) changes in the directories and files, and to delete 899 outside (non-Dired) changes in the directories and files, and to delete
870 part of the Dired buffer. 900 part of the Dired buffer.
871 901
958 arguments, @var{directory} and @var{regexp}; it chooses all the files in 988 arguments, @var{directory} and @var{regexp}; it chooses all the files in
959 @var{directory} or its subdirectories that contain a match for 989 @var{directory} or its subdirectories that contain a match for
960 @var{regexp}. It works by running the programs @code{find} and 990 @var{regexp}. It works by running the programs @code{find} and
961 @code{grep}. See also @kbd{M-x grep-find}, in @ref{Compilation}. 991 @code{grep}. See also @kbd{M-x grep-find}, in @ref{Compilation}.
962 Remember to write the regular expression for @code{grep}, not for Emacs. 992 Remember to write the regular expression for @code{grep}, not for Emacs.
993 (An alternative method of showing files whose contents match a given
994 regexp is the @kbd{% g @var{regexp}} command, see @ref{Marks vs Flags}.)
963 995
964 @findex find-dired 996 @findex find-dired
965 The most general command in this series is @kbd{M-x find-dired}, which 997 The most general command in this series is @kbd{M-x find-dired}, which
966 lets you specify any condition that @code{find} can test. It takes two 998 lets you specify any condition that @code{find} can test. It takes two
967 minibuffer arguments, @var{directory} and @var{find-args}; it runs 999 minibuffer arguments, @var{directory} and @var{find-args}; it runs