How to search a directory/directories in unix by excluding certain file
extensions
I've tried using
find . | grep -v '(.ext1|.ext2)$'
But it still returns those files ending with extensions .ext1 and .ext2.
Then i tried the following:
ls | grep -v ".ext1$" | grep -v ".ext2$"
and this works how i want it. Is there another way to do what i'm looking
for ? All i want to do is list all files or directories that do NOT end in
.ext1 or .ext2
No comments:
Post a Comment