linux search file based on file name pattern

linux, unix

Solution

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'

Problem

I want to search a series of files based on the files name. Here is my directory : For example I had the file on above. I only want to search out the file which is without _bak.

Original source

Related problems