0

I have this strange issue executing the following command on zsh using powerlevel10k. Honestly I have no clue what could be causing it, however, I removed all oh-my-zsh plugins just to try without luck.

The issue is as simple as:

❯ find -name *.yaml
zsh: no matches found: *.yaml

If I go to bash and execute the same command it works as intended

❯ bash
xxxx@merlin:~$ find -name *.yaml
./go/src/github.com/ ... 
{regular result list}

Do you have any ideas ? thanks in advance

  • 1
    [This issue](https://superuser.com/a/1217774/432690). The behavior of Zsh vs Bash explained at the beginning of [this answer](https://superuser.com/a/1607656/432690). – Kamil Maciorowski Feb 23 '21 at 12:31

2 Answers2

1

The shell is likely to be expanding *.yaml in the current directory (not found), so you need to escape it to make it work in find:

 find -name \*.yaml

If there was a file say suffix xyz.yaml in the current directory, your find command may adjust to explicit match on filename xyz.yaml, and not any ending .yaml:

 find -name xyz.yaml
DuncG
  • 532
  • 1
  • 3
  • 8
0

Another way to prevent shell expansion is to use single quotes around the wildcard character.

find -name '*.yaml'

Kevin
  • 46
  • 3