How to Uppercase/Lowercase text with sed

sed is a common Linux/Unix utility used to parse and transform text. Below are examples of uppercasing and lowercasing text with sed:

Uppercasing Text with sed

[a-z] is the regular expression which will match lowercase letters. \U& is used to replace these lowercase letters with the uppercase version.

Lowercasing Text with sed

[A-Z] is the regular expression which will match uppercase letters. \L& is used to replace these uppercase letters with the lowercase version.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">