linux search file based on file name pattern [closed]

If you’re wanting to limit your search to the current directory, use:

find . -maxdepth 1 -mindepth 1 ! -name '*_bak'

If you want to recursively find in all directories remove the -maxdepth 1.


Edit in response to OP’s comment

To get files that begin with ei and do not end with _bak use:

find . -type f -name 'ei*' -a ! -name '*_bak'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)