Function: find-dired

find-dired is an autoloaded, interactive and byte-compiled function defined in find-dired.el.gz.

Signature

(find-dired DIR ARGS)

Documentation

Run find and go into Dired mode on a buffer of the output.

The command run (after changing into DIR) is essentially

    find . \( ARGS \) -ls

except that the car of the variable find-ls-option specifies what to use in place of "-ls" as the final argument.

Collect output in the "*Find*" buffer. To kill the job before it finishes, type M-x kill-find (kill-find).

For more information on how to write valid find expressions for ARGS, see Info node (find) Finding Files. If you are not using GNU findutils (on macOS and *BSD systems), see instead the man page for "find".

View in manual

Probably introduced at or before Emacs version 19.20.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/find-dired.el.gz
;;;###autoload
(defun find-dired (dir args)
  "Run `find' and go into Dired mode on a buffer of the output.
The command run (after changing into DIR) is essentially

    find . \\( ARGS \\) -ls

except that the car of the variable `find-ls-option' specifies what to
use in place of \"-ls\" as the final argument.

Collect output in the \"*Find*\" buffer.  To kill the job before
it finishes, type \\[kill-find].

For more information on how to write valid find expressions for
ARGS, see Info node `(find) Finding Files'.  If you are not
using GNU findutils (on macOS and *BSD systems), see instead the
man page for \"find\"."
  (interactive (list (read-directory-name "Run find in directory: " nil "" t)
		     (read-string "Run find (with args): " find-args
				  (if find-args
                                      '(find-args-history . 1)
                                    'find-args-history))))
  (setq find-args args                ; save for next interactive call
	args (concat find-program " . "
		     (if (string= args "")
			 ""
		       (concat
			(shell-quote-argument "(")
			" " args " "
			(shell-quote-argument ")")
			" "))
		     (find-dired--escaped-ls-option)))
  (find-dired-with-command dir args))