reddit / emacs

How can I easily do the equivalent of (for example) print -l **/*-ts-*.el

pedzsanReddit · 2022-12-06 17:10
I am using Helm, project mode, and Projectile -- if those would help me on this quest. I'm in a buffer in a directory and I want to find all the files matching a pattern at or below the current directory. What is a simple (or perhaps the simplest) way to get that list? What I do now is switch to a terminal (outside of emacs) and using zsh I do `print -l **/*-ts-*.el` (or whatever pattern I'm looking for). It seems very likely that there is a simpler way to do this from within Emacs. I'm open to loading more applications on my laptop if that would help. This need seems to come up with me very often. Thank you
andyjda · 2022-12-06 17:37
If you just need the output of a single command, the easiest way to do this is probably by running `async-shell-command` with that same command. Here's a deeper look into shell-commands: [https://www.masteringemacs.org/article/executing-shell-commands-emacs](https://www.masteringemacs.org/article/executing-shell-commands-emacs) ​ Also, you don't have to switch to a terminal to run a shell. You can run a shell inside Emacs with `M-x shell` (it may default to a different shell than zsh, in which case you'll have to `(setq shell-file-name "/bin/zsh")` or replace the path with the path to your shell)
deaddyfreddy · 2022-12-06 18:30
does `M-x projectile-find-file` help?
pedzsanReddit · 2022-12-06 19:51
I thought it wasn't helping but somehow I was in the wrong project. Helm also gets involved and the trick is to do `\-ts-` instead of just `-ts-`. The problem with this is sometimes I'm not in a project.
karthink · 2022-12-06 20:26
Try `find-name-dired`. There should also be a Helm interface to the `find` or `fd` command in the package archives.