通过 linux 终端查找目录中的特定文件

Find specific files in a directory through linux terminal

我有一个包含n个文件的目录x。我需要通过仅键入一个命令来找出其中哪些名称中包含单词 y 或 z。

ls *x*|*z*
ls [*x*|*z*]

我该怎么做? 提前致谢!

使用查找。指定 ex 目录的路径,指定您只想查找文件(type-f)并使用 -name:

列出您想要的文件的几个掩码
find /path/to/x_directory -type f -name "*y*" -name "*z*"