Best Way to Find Files in Emacs

;; The Simple Way to Find Files by Name in Emacs

(global-set-key (kbd "C-c f") 'find-name-dired)

(global-set-key (kbd "C-c s") 'find-lisp-find-dired)

;; `find-name-dired' (requires the external `find' command)
;; Uses globbing patterns for matching file names:
;; `?' matches exactly one character, `*' matches zero or more characters

;; `find-lisp-find-dired' (requires no external app)
;; Uses Emacs regular expressions for matching file names
;; Especially useful for finding files with specific extensions
;; In this command, the case sensitivity of searches is determined by the variable `case-fold-search'
;; My "go to" command for file searching in Emacs

;; Extra
;; The find-dired command is based on the Unix find-command
;; URL: https://www.reddit.com/r/emacs/comments/agvaa4/a_better_way_to_find_files_by_name_in_emacs/

;; -name "*.txt"
;; -type f -empty
;; -size +1000M
;; -type f -iname "*aristotle*"
;; -iname *john*camp* -o -iname *camp*john*

Return to Home