I have a directory x which contains n files. I need to find which of them contains the word y or z in their name by typing just one command.
ls *x*|*z*
ls [*x*|*z*]
How can I do that? Thank you in advance!
I have a directory x which contains n files. I need to find which of them contains the word y or z in their name by typing just one command.
ls *x*|*z*
ls [*x*|*z*]
How can I do that? Thank you in advance!
use find. Specify path to your x directory, specify that you want to find only files (type-f) and list several masks for files you want with -name:
find /path/to/x_directory -type f -name "*y*" -name "*z*"