To find files by multiple file extensions I use in Linux smt like this (in terminal):
find ./ -type f \( -iname \*.txt -o -iname \*.json \)
And here result:
./test.txt
./project_1_1/test.json
./project_1_1/test1_1.txt
./project_1_2/test_1.2.txt
Nice. But what about Emacs? Is it possible in Emacs to find files with multiple file extensions and open result in separate buffer? I need this because then I want to delete all find files.
M-!. – NickD Nov 16 '23 at 22:27find-fileto open them all in emacs? – Maxim Kim Nov 16 '23 at 22:41M-x find-name-diredbe enough? – Manuel Uberti Nov 17 '23 at 07:43-execoption or the-execdiroption offind(both with the;and the+suffix), you should find out about them. You should also probably become familiar withxargs. OTOH, if you want to learn some Elisp, @shynur's answer contains a bunch of things that you probably want to learn. But the quickest and safest way to a solution to your problem is to add-execdir rm '{} \+to yourfindcommand. BTW, I would always run the initialfindcommand first to make sure that it is picking up only files you want removed. Then run it with-execdir .... – NickD Nov 17 '23 at 15:34execdiroption:-execdir rm '{}' \+. – NickD Nov 17 '23 at 16:45find-diredwith the args you prefer, e.g.,-name \*.json -o -name \*.txt. – Manuel Uberti Nov 20 '23 at 08:16