Q:

Grep using shell script to get files with some name less files with specified name

I need to get all files using shell script with some name X less files with name Y.
I'm trying to using grep -l -v to do it but i don`t really know how to use it.

A:

Considering that you want to get files from a dir:
Try this:
ls | grep "X" | grep -v "Y"

