4 ms·
The title seems a bit off since shell expansions and arguments has nothing to do with the find command. Both features are also often covered in entry level mat
by joana035 7y ago
The title seems a bit off since shell expansions and arguments has nothing to do with the find command.
Both features are also often covered in entry level material for introduction to shell.
- umanwizard 7y agoMost commands don’t accept the shell-like wildcard `*` as part of their command syntax; find does. That’s the connection.
- shmageggy 7y agoWell it seems the root of the problem is > * Most importantly, the 'find' command uses a different algorithm than shell globbing does when matching wildcard characters. More specifically, the find command will apply the search pattern against the base of the file name with all leading directories removed. This is contrasted from shell globbing which will expand the wildcard between each path component separately. When no path components are specified, the wildcard will match only files in the current directory.* So there does seem to be a `find` specific issue here
- deleted 7y ago[deleted]
- Izkata 7y agoThat's just ignorance about find. The globbing works fine, they're just not doing the search they think they are - they seem to think "-name" acts like "-path": $ ls Foobar/ one three two $ find . -path '*bar/t*' ./Foobar/two ./Foobar/three