Windows 10, Emacs 25.1

If I want to find file in Helm I use command helm-find-files. Suppose I want to find in current folder all files with extenstion *.gradle.

Here result:

Find all files with extension gradle in current folder

OK. It's work.

But now I want to find all files with extension *.gradle not only in current folder, but also in all subfolders (recursive). How I can do this by command helm-find-files?


Just type TAB, input shell and RET use Find shell command to find files with filename recursively.

Or simply C-c /


This will do what you want:

(defun my/helm-find-file-recursively ()  
  "Recursively find files in glob manner, in the specified directory."
  (helm-find 'ask-for-dir))

(global-set-key (kbd "C-c o f") 'my/helm-find-file-recursively)

Instead of doing this with helm-find-files, you could do it with helm-find. helm-find has the same fuzzy match but searches the directories recursively. It is smart in avoiding some not useful files / directories (like .git/ etc).

Just make sure you have find program installed on your machine. It comes by default on Unix based machines. On Windows, have git bash installed. Set Git bash to your default shell and then set the complete path of find to find-program variable in your .emacs file.

If you want to search from your default-directory. The standard shortcut is: C-x c /.

If you want to parameterize it with a different directory:

C-u C-x c /
<The directory to start search from> <RET>
<Your search string>

  • 1
    the second keybinding shd read C-u C-x c /. – mooseface Jul 18 '20 at 10:02
  • @mooseface, Thank you. Edited with the fix. – Vasantha Ganesh Jul 18 '20 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.