EN
Bash - text to lower case
9
points
I this short article, we would like to show how to convert text to lower case in Bash.
Quick solution:
echo "Some text here ..." | tr '[:upper:]' '[:lower:]'
Practical example
echo "Hi! My name is John." | tr '[:upper:]' '[:lower:]'
Example output:
hi! my name is john.
Alternative solutions
echo "Hi! My name is John." | awk '{print tolower($0)}'
echo "Hi! My name is John." | sed -e 's/\(.*\)/\L\1/'
Example output:
hi! my name is john.