Answer the question
In order to leave comments, you need to log in
Why is grep not filtering input?
Hello!
I'm trying to list all files with permissions, but grep, instead of listing lines that match the regular expression, just highlights the first character in those lines in red. Can you please tell me how to get a list of files without "total", empty lines and directory names?
ls -ARl $HOME | grep '^[-dbscpl]*'
Answer the question
In order to leave comments, you need to log in
ls -ARl $HOME | grep '^[-dbscpl]'
In your expression, '*' - means "zero or more" matches from the bracket - accordingly, almost all output falls under your regular expression
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question