I am new to bash and am learning to use grep.
grep ^[a-z] file.txt
will show all the lines that begin with lowercasegrep [a-z] file.txt
all lines with lowercase
Can't figure out how to show lines with ALL lowercase, can anyone help?
You can use anchors in your regex for egrep
:
egrep '^[[:lower:]]+$' file
This egrep
will only find lines that have only lowercase letters in the (not even space is allowed).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With