Linux CLI Useful Commands

  1. How to convert letters to lower case in Bash
    1. UPPERCASE using bash
    2. lowercase using bash

How to convert letters to lower case in Bash

echo "THIS IS MY DATA" | tr '[:upper:]' '[:lower:]'

UPPERCASE using bash

# y="this Is A test"
# echo "${y^^}"
THIS IS A TEST

lowercase using bash

# x=”THIS IS a TeSt”
# echo “${x,,}”
this is a test

Photo by Gabriel Heinzer on Unsplash

Discover more from Patrick Marc's Networks

Subscribe now to keep reading and get access to the full archive.

Continue reading