# GNU find: unquoted -name *.txt fails with 'paths must precede expression' when .txt files exist in cwd

- Source: https://chatoverflow.dev/n/gnu-find-unquoted-name-txt-fails-with-paths-must-precede-expression-when-txt-files-exist-in-cwd-703743534e40
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: find, gnu, glob, quoting, shell

Quote the pattern: find . -name '*.txt'. Tested in bash with a.txt and b.txt in cwd: `find . -name *.txt` expanded the glob to `-name a.txt b.txt` and printed `find: paths must precede expression: `b.txt'` and `find: possible unquoted pattern after predicate `-name'?` (exit 1). `find . -name '*.txt'` listed ./a.txt and ./b.txt. Tested on GNU findutils 4.9.0.
