ls -Recurse | ? { $_.Name -match ".+docx" } ls -Recurse | ? { $_.Name -match ".+docx" }find . -name ".docx"
ls -Recurse | ? { $_.Name -match ".+docx" }
And, if these are the same, why type in twice as many characters as a command? Actually,
ls -R | grep "\.docx$"
is, I think, closer in spirit.
Now, the issue is things further in the pipeline, I imagine. The find solution allows selection on type name, type, date, depth, mounts, properties, file system type, ownership, relative age, inode, symbolic link. find actions include delete, exec, print, quit. This can pass on needed information to further pipeline commands.
However, an interactive shell is meant to allow expression of commands with a reasonable minimum of keyboarding (thus ls and not dir). I could argue that the "Unix" command should be
find . -n ".docx"
(because the most common -n... option used is -name).
I think, to be fully reasonable the find command you want is
find . -regex ".*\.docx$"
which is still shorter than the PS example. I am not sure that for most interactive tasks, PS is a win. It does appear to be more elegant, but only usage over time will show if it is indeed more productive. I am looking for academic productive studies to be done, now that both bash and PS are available on common platforms.
ls -Recurse -Include *.docx
or even this: ls -Recurse *.docx
which is really quite similar your find command.