I am in a folder where I do not have read permission in contents.
ls -l
List all files sucessfully.
I want to count files that have some attributes in their name with:
ls -l | grep file????.tar.gz | wc -l
The command above generates a lot of permission denied messages and finally I get no answer.
Why this happens and is there a workaround?
EDIT: Following Josip Rodin's Suggestion turns out I messed up using the wrong wildcard character. Executing:
ls -l | grep -e "file....\.tar.gz" | wc -l
worked like a charm