Ubuntu 16.04 LTS

Is there a way to test if a directory has a specific name and do some action? For instance, I have these ones:

```
/home/Al/dir
/home/Fl/dir
/usr/.../dir

```

If `pwd` returns any of these directories I want the test to return true (also for all directories ending with `dir` like this `/.../.../dir`). Is there a way to perform such a test?