{"id":35724,"date":"2024-02-01T07:17:44","date_gmt":"2024-02-01T07:17:44","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=35724"},"modified":"2024-03-31T06:13:59","modified_gmt":"2024-03-31T06:13:59","slug":"bash-to-lowercase","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/","title":{"rendered":"How to Convert Bash String to Lowercase? [7 Methods]"},"content":{"rendered":"<p style=\"text-align: justify;\">In Bash scripting, case conversion is important for case-sensitive comparison, pattern matching, and file and directory operations. So for an effective and efficient conversion of Bash string to lowercase, a clear concept of case conversion is essential.<\/p>\n<p style=\"text-align: justify;\">To convert a Bash string to lowercase, check the following methods:<\/p>\n<ol>\n<li>Using Parameter Expansion: <code class=\"\" data-line=\"\">${String,,}<\/code><\/li>\n<li>Using \u201ctr\u201d command: <code class=\"\" data-line=\"\">tr [Option] [set1] [set2]<\/code>, here the tr command translates or deletes <strong>set1<\/strong> with<strong> set2<\/strong>.<\/li>\n<li>Using declare command: <code class=\"\" data-line=\"\">declare -l variable_name<\/code><\/li>\n<li>Using awk command: <code class=\"\" data-line=\"\">echo &quot;input_str&quot; | awk &#039;pattern { action }&#039;<\/code><\/li>\n<li>Using sed command: <code class=\"\" data-line=\"\">sed &#039;s\/pattern\/replacement\/&#039; filename<\/code><\/li>\n<li>Using perl command: <code class=\"\" data-line=\"\">echo &quot;$input_string&quot; | perl [Option] &#039;action&#039;<\/code><\/li>\n<li>Using ASCII value with a case statement and a for loop.<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">Dive into the article to learn these methods of how to convert a bash string to lowercase in detail.<\/p>\n<div class=\"su-button-center\"><a href=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/Practice-Files_Convert-String-to-Lowercase-in-Bash.zip\" class=\"su-button su-button-style-default\" style=\"color:#000000;background-color:#E8F9FF;border-color:#bac8cc;border-radius:56px\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color:#000000;padding:8px 26px;font-size:20px;line-height:30px;border-color:#effbff;border-radius:56px;text-shadow:0px 0px 0px #000000\"><i class=\"sui sui-download\" style=\"font-size:20px;color:#1AA1D6\"><\/i> Practice Files to Convert String To Lowercase in Bash<\/span><\/a><\/div>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#7_Methods_to_Convert_a_String_to_Lowercase\" >7 Methods to Convert a String to Lowercase<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#1_Using_Parameter_Expansion_With_%E2%80%9C%E2%80%9D_Operator\" >1. Using Parameter Expansion With \u201c,,\u201d Operator<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#A_Convert_All_Characters_to_Lowercase\" >A. Convert All Characters to Lowercase<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#B_Convert_the_First_Character_to_Lowercase\" >B. Convert the First Character to Lowercase<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#C_Convert_a_Specific_Character_Using_Pattern\" >C. Convert a Specific Character Using Pattern<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#2_Using_%E2%80%9Ctr%E2%80%9D_Command\" >2. Using \u201ctr\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#3_Using_%E2%80%9Cdeclare%E2%80%9D_Command\" >3. Using \u201cdeclare\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#4_Using_%E2%80%9Cawk_Command\" >4. Using \u201cawk\u2019 Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#5_Using_%E2%80%9Csed%E2%80%9D_Command\" >5. Using \u201csed\u201d Command<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#Convert_a_Specific_Character\" >Convert a Specific Character<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#6_Using_%E2%80%9CPerl%E2%80%9D_Command\" >6. Using \u201cPerl\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#7_Using_the_ASCII_Value\" >7. Using the ASCII Value<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#People_Also_Ask\" >People Also Ask<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#How_to_convert_a_bash_string_to_lowercase\" >How to convert a bash string to lowercase?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#How_to_convert_a_string_to_uppercase\" >How to convert a string to uppercase?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#Which_function_converts_a_string_to_lowercase\" >Which function converts a string to lowercase?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#How_to_convert_a_specific_character_between_the_same_characters_to_lowercase_in_bash\" >How to convert a specific character between the same characters to lowercase in bash?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#How_to_convert_a_multibyte_character_to_lowercase\" >How to convert a multibyte character to lowercase?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"7_Methods_to_Convert_a_String_to_Lowercase\"><\/span>7 Methods to Convert a String to Lowercase<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">The basic and simple way to convert a string&#8217;s characters to lowercase is by using the <code class=\"\" data-line=\"\">tr<\/code> command. There are some other commands like <code class=\"\" data-line=\"\">awk<\/code>, <code class=\"\" data-line=\"\">sed<\/code> which gives flexibility while converting multibyte characters. In this section, <strong>7 methods<\/strong> will be discussed which have been mentioned earlier on how to convert a string to lowercase.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_Using_Parameter_Expansion_With_%E2%80%9C%E2%80%9D_Operator\"><\/span>1. Using Parameter Expansion With \u201c,,\u201d Operator<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To convert a string to lowercase, you can use parameter expansion. <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/expansion\/parameter-expansion\/\" target=\"_blank\" rel=\"noopener\"><strong>Parameter expansion<\/strong><\/a> refers to retrieving and manipulating the value that is stored in the parameter or variable. By using parameter expansion with<code class=\"\" data-line=\"\">,<\/code>,<code class=\"\" data-line=\"\">,,<\/code>, you can convert the first character of a string to lowercase, as well as convert all the characters in the string to lowercase.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"A_Convert_All_Characters_to_Lowercase\"><\/span>A. Convert All Characters to Lowercase<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>To convert all characters of a string to lowercase using<code class=\"\" data-line=\"\">,,<\/code>, follow the below script:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\noriginal_string=&quot;HELLO WORLD&quot;\nlowercase_string=&quot;${original_string,,}&quot;\n\necho &quot;Original String: $original_string&quot;\necho &quot;Lowercase String: $lowercase_string&quot;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p style=\"text-align: justify;\">Firstly the script declares a string into a variable named<code class=\"\" data-line=\"\">original_string<\/code>. Then the script uses a bash parameter expansion syntax<code class=\"\" data-line=\"\">${original_string,,}<\/code> which converts all the characters of the original_string to lowercase. Later, the <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/output\/echo-command\/\" target=\"_blank\" rel=\"noopener\"><strong>echo command<\/strong><\/a> prints the converted output in the terminal.<\/div><\/div>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-35729 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1.-Using-Operator.png\" alt=\"Convert to uppercase to lowercase using operator\" width=\"556\" height=\"196\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1.-Using-Operator.png 556w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1.-Using-Operator-300x106.png 300w\" sizes=\"(max-width: 556px) 100vw, 556px\" \/><\/p>\n<p style=\"text-align: justify;\">From the output, you can see the script converted all the characters of the input string to lowercase.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"B_Convert_the_First_Character_to_Lowercase\"><\/span>B. Convert the First Character to Lowercase<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p style=\"text-align: justify;\">To convert only the first character to lowercase, replace the<code class=\"\" data-line=\"\">,,<\/code>with <code class=\"\" data-line=\"\">,<\/code>in the code that you have used earlier to convert all characters to lowercase. Check the code:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\noriginal_string=&quot;HELLO WORLD&quot;\nlowercase_string=&quot;${original_string,}&quot;\n\necho &quot;Original String: $original_string&quot;\necho &quot;Lowercase String: $lowercase_string&quot;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p style=\"text-align: justify;\">The <code class=\"\" data-line=\"\">&quot;${original_string,}&quot;<\/code> converts the first character of the original_string to lowercase.<\/div><\/div>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-35730 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2.-Firstchar.png\" alt=\"Convert the first character to lowercase\" width=\"594\" height=\"212\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2.-Firstchar.png 594w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2.-Firstchar-300x107.png 300w\" sizes=\"(max-width: 594px) 100vw, 594px\" \/><\/p>\n<p>Here the script only converts the first character of the string to lowercase.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"C_Convert_a_Specific_Character_Using_Pattern\"><\/span>C. Convert a Specific Character Using Pattern<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>To convert a specific character using a pattern, check the following code:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n# Declare a string\nstring=&quot;HERE, ALL THE STRING IN UPPERCASE&quot;\n\n# Converts the first letter to lowercase if it\u2019s \u2018H\u2019\necho &quot;${string,H}&quot;\n\n# Convert all occurrences of &#039;L&#039; to lowercase\necho &quot;${string,,L}&quot;\n\n# Convert all occurrences of any of the characters in &#039;STRING&#039; to lowercase\necho &quot;${string,,[STRING]}&quot;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p style=\"text-align: justify;\">Firstly the bash script declares a string named \u201cstring\u201d. Here the <code class=\"\" data-line=\"\">${string,H}<\/code> checks if the first character of the string is <code class=\"\" data-line=\"\">H<\/code>, then it will convert the found <code class=\"\" data-line=\"\">H<\/code> to lowercase. After that, the <code class=\"\" data-line=\"\">${string,,L}<\/code> converts all the occurrences of the character<code class=\"\" data-line=\"\">L<\/code>to lowercase. Lastly, the <code class=\"\" data-line=\"\">${string,,[STRING]}<\/code> changes all the occurrences of any character in STRING to lowercase.<\/div><\/div>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-35731 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3.-Matching-pattern.png\" alt=\"Matching pattern of the string converted to lowercase in bash\" width=\"825\" height=\"260\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3.-Matching-pattern.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3.-Matching-pattern-300x95.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3.-Matching-pattern-768x242.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<p style=\"text-align: justify;\">The script successfully converts the first character, a specific character, and a group of characters to lowercase.<\/p>\n<div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#e8f9fc;border-color:#ffffff;color:#333333;\">\n<p style=\"text-align: justify;\"><strong>Note:<\/strong> The use of <code class=\"\" data-line=\"\">~<\/code> in parameter expansion allows you to switch the case of the first character, while <code class=\"\" data-line=\"\">~~<\/code> switches the case of all characters. This results in a modification of the current character, alternating between lowercase and uppercase.<\/div><\/div>\n<h3><span class=\"ez-toc-section\" id=\"2_Using_%E2%80%9Ctr%E2%80%9D_Command\"><\/span>2. Using \u201ctr\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To convert the upper case character to a lower case character, you can use the <a href=\"https:\/\/linuxsimply.com\/tr-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>tr command<\/strong><\/a>. In bash scripting, the tr command is used to translate and delete characters. Take a look at the following script to convert a string from upper case to lower case:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\nOriginal_string=&quot;ALL THE CHARACTERS ARE IN UPPERCASE&quot;\nlowercase_string=$(echo &quot;$Original_string&quot; | tr &#039;[:upper:]&#039; &#039;[:lower:]&#039;)\n\necho &quot;Original String: $Original_string&quot;\necho &quot;Lowercase String: $lowercase_string&quot;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p style=\"text-align: justify;\">At first, the bash script declares a string in a variable named<code class=\"\" data-line=\"\">Original_string<\/code>. In the <code class=\"\" data-line=\"\">lowercase_string=$(echo &quot;$Original_string&quot; | tr &#039;[:upper:]&#039; &#039;[:lower:]&#039;)<\/code>, the <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/\" target=\"_blank\" rel=\"noopener\"><strong>| (pipe)<\/strong><\/a> symbol pipes the output of the<code class=\"\" data-line=\"\">echo<\/code>command to the<code class=\"\" data-line=\"\">tr<\/code>command. Then the <strong>tr command<\/strong> matches the upper-case characters and replaces them with lowercase characters.<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-35733 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4.-Using-tr-command.png\" alt=\"Convert to lowercase in bash using tr command\" width=\"825\" height=\"203\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4.-Using-tr-command.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4.-Using-tr-command-300x74.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4.-Using-tr-command-768x189.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<p style=\"text-align: justify;\">From the output you can see, that the script converts the characters from upper case to lower case.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_Using_%E2%80%9Cdeclare%E2%80%9D_Command\"><\/span>3. Using \u201cdeclare\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">While declaring a variable, if you use the <code class=\"\" data-line=\"\">-l<\/code> attribute with declare command then it will convert any value of the declared variable to lowercase. To convert a string to lowercase using the declare command, check the following script:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n# Declare a string and convert it to lowercase\ndeclare -l str=&quot;CONVERTING THE STRING INTO LOWERCASE&quot;\n\n# Print the string\necho $str<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p style=\"text-align: justify;\">At first, the bash script declares a string into a variable named str. Moreover, the script uses the -l option with the <a href=\"https:\/\/linuxsimply.com\/declare-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>declare command<\/strong><\/a> which converts all the characters to lowercase. At last, the echo command prints the output of the str variable in the terminal.<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-35735 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5.-Declare.png\" alt=\"Using the declare command with -l option to convert to lowercase\" width=\"605\" height=\"157\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5.-Declare.png 605w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5.-Declare-300x78.png 300w\" sizes=\"(max-width: 605px) 100vw, 605px\" \/><\/p>\n<p>The output shows that the declare command has converted the characters to lowercase.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_Using_%E2%80%9Cawk_Command\"><\/span>4. Using \u201cawk\u2019 Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To convert the case of a string to lowercase, you can use the <a href=\"https:\/\/linuxsimply.com\/awk-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>awk command<\/strong><\/a>. The awk is a versatile command tool used for text processing, handling multi-byte characters, and especially for pattern matching and manipulation. The awk command uses a tolower function to change the case of the characters of a given string.<\/p>\n<p>Here&#8217;s the script to convert the character of a string to lowercase using the awk command:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n# Define the input string\ninput_string=&quot;BASH LOWERCASE&quot;\n\n# Use echo to print the original string and then pipe it to awk for lowercase conversion\necho &quot;$input_string&quot; | awk &#039;{print tolower($0)}&#039;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p style=\"text-align: justify;\">The script uses <code class=\"\" data-line=\"\">|<\/code>(pipe) operator to take the output of the<code class=\"\" data-line=\"\">echo<\/code>command to the<code class=\"\" data-line=\"\">awk<\/code>command. In the awk <code class=\"\" data-line=\"\">&#039;{print tolower($0)}&#039;<\/code>, the <strong>awk command<\/strong> converts the <strong>echo<\/strong> command output to lowercase using its function tolower. In <code class=\"\" data-line=\"\">tolower($0)<\/code>, the <code class=\"\" data-line=\"\">($0)<\/code> indicates the entire output from the pipe operator.<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-35736 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6.-awk.png\" alt=\"Using the awk command convert a string to lowercase\" width=\"588\" height=\"143\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6.-awk.png 588w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6.-awk-300x73.png 300w\" sizes=\"(max-width: 588px) 100vw, 588px\" \/><\/p>\n<p style=\"text-align: justify;\">The script converts the characters to lowercase using the awk command with the tolower function.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_Using_%E2%80%9Csed%E2%80%9D_Command\"><\/span>5. Using \u201csed\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The <a href=\"https:\/\/linuxsimply.com\/sed-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>sed command<\/strong><\/a> is a simple yet very useful command for stream editors in bash scripting. The sed command uses a special sequence that includes backslashes and one of the following letters L, l, U, u, E. These sequences have a special meaning, like:<\/p>\n<ul>\n<li><strong>\\L:<\/strong> Continue the replacement to lowercase until you find \\U or \\E.<\/li>\n<li><strong>\\ l:<\/strong> Turn the next character to lowercase.<\/li>\n<li><strong>\\U:<\/strong> Continue the replacement to uppercase until you find \\U or \\E.<\/li>\n<li><strong>\\u:<\/strong> Turn the next character to uppercase.<\/li>\n<li><strong>\\E:<\/strong> Stoped case conversion started by \\U and \\L.<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">The sed command mainly uses these sequences for case conversion.<\/p>\n<p style=\"text-align: justify;\">To convert a string to lowercase using the sed command, follow the script below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n# Method 1\nmed1=$(echo &#039;Bash Lowercase with SED&#039; | sed -e &#039;s\/\\(.*\\)\/\\L\\1\/&#039;)\n\necho &quot;Method1: $med1&quot;\n\n# Method 2\nmed2=$(echo &#039;Bash Lowercase with SED&#039; | sed &#039;s\/.*\/\\L&amp;\/g&#039;)\n\necho &quot;Method2: $med2&quot;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p style=\"text-align: justify;\">Firstly in method 1, the<code class=\"\" data-line=\"\">sed<\/code>command takes the output through the pipe operator. In the <strong>sed<\/strong> command <code class=\"\" data-line=\"\">\\(.*\\)<\/code> captures the string and the<code class=\"\" data-line=\"\">\\L<\/code>converts the strings\u2019 characters to lowercase. Later in method 2, the script uses<code class=\"\" data-line=\"\">&#039;s\/.*\/\\L&amp;\/g&#039;<\/code>which also converts the characters to lowercase. It uses<code class=\"\" data-line=\"\">-g<\/code>flag which globally replaces all the characters in the output.<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-35737 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7.-Using-sed.png\" alt=\"Using the sed command convert characters to lowercase in bash \" width=\"700\" height=\"190\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7.-Using-sed.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7.-Using-sed-300x81.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>From the output, you can see the inputs\u2019 uppercase characters have converted to lowercase.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Convert_a_Specific_Character\"><\/span>Convert a Specific Character<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p style=\"text-align: justify;\">To convert a specific character to lowercase using the sed command, take a look at the following script:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\nMain_string=&quot;Hello World&quot;\nNew_string=$(echo &quot;$Main_string&quot; | sed -e &#039;s\/H\/h\/g&#039; -e &#039;s\/W\/w\/g&#039;)\n\necho &quot;Main_string:&quot; $Main_string\necho &quot;Modified_string:&quot; $New_string<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p style=\"text-align: justify;\">In the <code class=\"\" data-line=\"\">$(echo &quot;$Main_string&quot; | sed -e &#039;s\/H\/h\/g&#039; -e &#039;s\/W\/w\/g&#039;)<\/code>, the pipe operator takes the output of the<code class=\"\" data-line=\"\">echo<\/code>command and pipes it as input to the <strong>sed command<\/strong>. The<code class=\"\" data-line=\"\">sed<\/code> command replaces the character<code class=\"\" data-line=\"\">H<\/code>with<code class=\"\" data-line=\"\">h<\/code>and<code class=\"\" data-line=\"\">W<\/code>with<code class=\"\" data-line=\"\">w<\/code>globally. At last, the bash script stores the modified string in the New_string variable.<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-35738 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/8.-Replacechar.png\" alt=\"Convert a specific character using the sed command \" width=\"698\" height=\"181\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/8.-Replacechar.png 698w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/8.-Replacechar-300x78.png 300w\" sizes=\"(max-width: 698px) 100vw, 698px\" \/><\/p>\n<p style=\"text-align: justify;\">The output shows that the script replaces the first character of the words from upper case to lower case.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"6_Using_%E2%80%9CPerl%E2%80%9D_Command\"><\/span>6. Using \u201cPerl\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In bash scripting, the <strong>Perl command<\/strong> provides a simple way to convert strings to lowercase. The Perl command reads each line of the input then uses the lc function to convert the input to lowercase and later it displays the modified output. To convert a string to lowercase using the Perl command, check the following script:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\ninput_string=&quot;Bash Lowercase with Perl&quot;\n\necho &quot;$input_string&quot; | perl -ne &#039;print lc&#039;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p style=\"text-align: justify;\">In the<code class=\"\" data-line=\"\">perl -ne<\/code>command, the<code class=\"\" data-line=\"\">-n<\/code>option makes the <strong>perl command<\/strong> process the input line by line and the <code class=\"\" data-line=\"\">-<\/code>option executes the perl command in the terminal. Later, the <code class=\"\" data-line=\"\">&#039;print lc&#039;<\/code> syntax, prints the converted lowercase of the input characters using the <code class=\"\" data-line=\"\">lc<\/code> function.<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-35739 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/9.-Using-perl.png\" alt=\"Using perl command convert the case of the article\" width=\"574\" height=\"189\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/9.-Using-perl.png 574w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/9.-Using-perl-300x99.png 300w\" sizes=\"(max-width: 574px) 100vw, 574px\" \/><\/p>\n<p style=\"text-align: justify;\">The output shows the script converts the uppercase characters <code class=\"\" data-line=\"\">B<\/code>, <code class=\"\" data-line=\"\">L<\/code>, and <code class=\"\" data-line=\"\">P<\/code> to lowercase <code class=\"\" data-line=\"\">b<\/code>, <code class=\"\" data-line=\"\">l<\/code>, and <code class=\"\" data-line=\"\">p<\/code> respectively.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"7_Using_the_ASCII_Value\"><\/span>7. Using the ASCII Value<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To convert the case of a string to lowercase, you can also use the <strong>ASCII<\/strong> value of the characters and arithmetic operations. Here\u2019s the script:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash \n\nlc(){ \ncase &quot;$1&quot; in [A-Z]) \n\nn=$(printf &quot;%d&quot; &quot;&#039;$1&quot;) \nn=$((n+32))\n \nprintf \\\\$(printf &quot;%o&quot; &quot;$n&quot;) ;; *) \nprintf &quot;%s&quot; &quot;$1&quot; \n;; \nesac \n} \nword=&quot;THIS IS a ASCII value.&quot; \n\nfor((i=0;i&lt;${#word};i++)) do \nch=&quot;${word:$i:1}&quot; \nlc &quot;$ch&quot; \ndone \n\nprintf &quot;\\n&quot;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p style=\"text-align: justify;\">At first, the script declares a bash function named lc(). This function takes one input argument using the $1. In the function, the script uses a case statement that checks the uppercase character [A-Z] and converts them into lowercase by adding 32 to the ASCII value of uppercase characters. After converting to lowercase, the printf \\\\$(printf &#8220;%o&#8221; &#8220;$n&#8221;) prints the output using the octal form. If the character is not in uppercase, the\u00a0 *) syntax executes the later print command to print it as it is. In the <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/for-loop\/\" target=\"_blank\" rel=\"noopener\"><strong>for loop<\/strong><\/a>, the ${#word} syntax counts the length of the input string, and ch=&#8221;${word:$i:1}&#8221; syntax extracts a single character at each iteration and converts it to lowercase using the lc function.<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-35740 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/10.-Ascii.png\" alt=\"Convert the characters using its ASCII value\" width=\"620\" height=\"202\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/10.-Ascii.png 620w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/10.-Ascii-300x98.png 300w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/p>\n<p style=\"text-align: justify;\">From the image you can see the script converts uppercase characters of the string \u201cTHIS IS a ASCII value.\u201d to lowercase characters, \u201cthis is a ascii value.\u201d<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">To sum up, the article shows multiple methods to convert a string to lowercase. While dealing with multibyte characters, the tr command will not show the expected result. On the other hand, the awk and sed command shows flexibility while handling multibyte characters. In the conversion of case, parameter expansion also shows versatile results. Hope this guide will give you a clear concept of converting a bash string to lowercase.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"People_Also_Ask\"><\/span>People Also Ask<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"How_to_convert_a_bash_string_to_lowercase\"><\/span>How to convert a bash string to lowercase?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To convert a Bash string to lowercase, you can use the tr command with the syntax: <code class=\"\" data-line=\"\">tr &#039;[:upper:]&#039; &#039;[:lower:]&#039;<\/code>. Simply use this syntax within a pipeline to convert uppercase input into lowercase. For instance, <code class=\"\" data-line=\"\">echo &#039;LINUX&#039; | tr &#039;[:upper:]&#039; &#039;[:lower:]&#039;<\/code>, here sample output is: <strong>linux<\/strong>. Or, you can also feed the stdin file containing uppercase strings to the tr command by using input redirection. Like this, <code class=\"\" data-line=\"\">tr &#039;[:upper:]&#039; &#039;[:lower:]&#039; &lt; file.txt<\/code>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_convert_a_string_to_uppercase\"><\/span>How to convert a string to uppercase?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To convert a string from lowercase to uppercase, you can use the tr command. See the following code for better understanding:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\nOriginal_string=&quot;all the characters are in uppercase&quot;\nuppercase_string=$(echo &quot;$Original_string&quot; | tr &#039;[:lower:]&#039; &#039;[:upper:]&#039;)\n\necho &quot;Original String: $Original_string&quot;\necho &quot;Uppercase String: $uppercase_string&quot;\n\n#output:Original String: all the characters are in uppercase\n#Uppercase String: ALL THE CHARACTERS ARE IN UPPERCASE<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Which_function_converts_a_string_to_lowercase\"><\/span>Which function converts a string to lowercase?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To convert a string to lowercase you can use <code class=\"\" data-line=\"\">{string,,}<\/code> and tr command. There is no direct function to convert a string to lowercase. You can use <code class=\"\" data-line=\"\">tolower<\/code> and <code class=\"\" data-line=\"\">lc<\/code> functions but for this, you need to use external commands like awk and perl.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_convert_a_specific_character_between_the_same_characters_to_lowercase_in_bash\"><\/span>How to convert a specific character between the same characters to lowercase in bash?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To convert a specific character to lowercase you can use the awk text processing command. Inside the awk command use the gsub function which stands for global substitution. With <code class=\"\" data-line=\"\">(\/W\/, &quot;w&quot;, $2)<\/code>, the script converts the <code class=\"\" data-line=\"\">W<\/code> to <code class=\"\" data-line=\"\">w<\/code> of the word \u201cWORLD\u201d. Check the script below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n# Declare a string\nstring=&quot;HELLO WORLD WITH MULTIPLE Ws&quot;\n\n# Replace only the second occurrence of &#039;W&#039; with &#039;w&#039;\necho &quot;$string&quot; | awk &#039;{gsub(\/W\/, &quot;w&quot;, $2)}1&#039;\n\n#output:HELLO wORLD WITH MULTIPLE Ws<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"How_to_convert_a_multibyte_character_to_lowercase\"><\/span>How to convert a multibyte character to lowercase?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To convert a multibyte character to lowercase, you can use the <code class=\"\" data-line=\"\">Perl<\/code> command. Here with the Perl command use the <strong>-CS<\/strong> option to enable the <strong>UTF-8<\/strong> mode. The <code class=\"\" data-line=\"\">lc($_)<\/code> function converts each character to lowercase. Here\u2019s the script:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Converting the multibyte characters to lowercase\ninput_string=&quot;HELLO \u00c6\u00d8\u00c5&quot;\nlowercase_string=$(echo &quot;$input_string&quot; | perl -CS -pe &#039;$_ = lc($_)&#039;)\n\necho &quot;$lowercase_string&quot;\n\n#output: hello \u00e6\u00f8\u00e5<\/code><\/pre>\n<p><script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [{\n    \"@type\": \"Question\",\n    \"name\": \"How to convert a bash string to lowercase?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"To convert a Bash string to lowercase, you can use the tr command with the syntax: tr '[:upper:]' '[:lower:]'. Simply use this syntax within a pipeline to convert uppercase input into lowercase. For instance, echo 'LINUX' | tr '[:upper:]' '[:lower:]', here sample output is: linux. Or, you can also feed the stdin file containing uppercase strings to the tr command by using input redirection. Like this, tr '[:upper:]' '[:lower:]' < file.txt.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"Which function converts a string to lowercase?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"To convert a string to lowercase you can use {string,,} and tr command. There is no direct function to convert a string to lowercase. You can use tolower and lc functions but for this, you need to use external commands like awk and perl.\"\n    }\n  }]\n}\n<\/script><\/p>\n<p><span style=\"font-size: 18pt; color: #003366;\"><strong>Related Articles<\/strong><\/span><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/string-to-int\/\" target=\"_blank\" rel=\"noopener\">How to Convert a Bash String to Int? [8 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/format-string\/\" target=\"_blank\" rel=\"noopener\">How to Format a String in Bash? [Methods, Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/convert-to-uppercase\/\" target=\"_blank\" rel=\"noopener\">How to Convert Bash String to Uppercase? [7 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/string-replace\/\" target=\"_blank\" rel=\"noopener\">How to Replace String in Bash? [5 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/trim-string\/\" target=\"_blank\" rel=\"noopener\">How to Trim String in Bash? [6 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/truncate-string\/\" target=\"_blank\" rel=\"noopener\">How to Truncate String in Bash? [5 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/remove-character\/\" target=\"_blank\" rel=\"noopener\">How to Remove Character from String in Bash? [7+ Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/remove-first-character\/\" target=\"_blank\" rel=\"noopener\">How to Remove First Character From Bash String? [7 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/remove-last-character\/\" target=\"_blank\" rel=\"noopener\">How to Remove Last Character from Bash String [6 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/string-functions\/\" target=\"_blank\" rel=\"noopener\">How to Use String Functions in Bash? [Examples Included]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/generate-random-string\/\" target=\"_blank\" rel=\"noopener\">How to Generate a Random String in Bash? [8 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/string-array\/\" target=\"_blank\" rel=\"noopener\">How to Manipulate Bash String Array [5 Ways]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/here-string\/\" target=\"_blank\" rel=\"noopener\">How to Use \u201cHere String\u201d in Bash? [Basic to Advance]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/base64-encode-decode\/\" target=\"_blank\" rel=\"noopener\">Encode and Decode with \u201cbase64\u201d in Bash [6 Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-eval\/\" target=\"_blank\" rel=\"noopener\">How to Use \u201ceval\u201d Command in Bash? [8 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/get-first-character\/\" target=\"_blank\" rel=\"noopener\">How to Get the First Character from Bash String? [8 Methods]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<p><strong>&lt;&lt; Go Back to <span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;String Manipulation in Bash&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1074113,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;16&quot;:12,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/\" target=\"_blank\" rel=\"noopener\">String Manipulation in Bash<\/a><\/span> | <span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash String&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1074113,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;16&quot;:12,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/\" target=\"_blank\" rel=\"noopener\">Bash String<\/a><\/span> | <span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash Scripting Tutorial&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1074113,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;16&quot;:12,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/\" target=\"_blank\" rel=\"noopener\">Bash Scripting Tutorial<\/a><\/span><\/strong><\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;35724&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;How to Convert Bash String to Lowercase? [7 Methods]&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>In Bash scripting, case conversion is important for case-sensitive comparison, pattern matching, and file and directory operations. So for an &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Convert Bash String to Lowercase? [7 Methods]\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#more-35724\" aria-label=\"Read more about How to Convert Bash String to Lowercase? [7 Methods]\">Read more<\/a><\/p>\n","protected":false},"author":314907,"featured_media":35742,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[192],"class_list":["post-35724","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash-scripting","tag-string-manipulation","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Convert Bash String to Lowercase? [7 Methods] - LinuxSimply<\/title>\n<meta name=\"description\" content=\"Explore the article to learn how to convert bash string to lowercase characters and enhance your knowledge for effective case conversion.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Convert Bash String to Lowercase? [7 Methods] - LinuxSimply\" \/>\n<meta property=\"og:description\" content=\"Explore the article to learn how to convert bash string to lowercase characters and enhance your knowledge for effective case conversion.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/afia.zahin.7796?mibextid=ZbWKwL\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-01T07:17:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-31T06:13:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/lowercase.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Afia Zahin Oishi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Afia Zahin Oishi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/bash-to-lowercase\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/bash-to-lowercase\\\/\"},\"author\":{\"name\":\"Afia Zahin Oishi\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/2afb5d809ba746cd33b77eb2639949d7\"},\"headline\":\"How to Convert Bash String to Lowercase? [7 Methods]\",\"datePublished\":\"2024-02-01T07:17:44+00:00\",\"dateModified\":\"2024-03-31T06:13:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/bash-to-lowercase\\\/\"},\"wordCount\":2039,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/bash-to-lowercase\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/lowercase.png\",\"keywords\":[\"string manipulation\"],\"articleSection\":[\"Bash Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/bash-to-lowercase\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/bash-to-lowercase\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/bash-to-lowercase\\\/\",\"name\":\"How to Convert Bash String to Lowercase? [7 Methods] - LinuxSimply\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/bash-to-lowercase\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/bash-to-lowercase\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/lowercase.png\",\"datePublished\":\"2024-02-01T07:17:44+00:00\",\"dateModified\":\"2024-03-31T06:13:59+00:00\",\"description\":\"Explore the article to learn how to convert bash string to lowercase characters and enhance your knowledge for effective case conversion.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/bash-to-lowercase\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/bash-to-lowercase\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/bash-to-lowercase\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/lowercase.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/lowercase.png\",\"width\":400,\"height\":400,\"caption\":\"An overview of converting bash string to lowercase\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/bash-to-lowercase\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bash Scripting Tutorial\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Bash String\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"String Manipulation in Bash\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/manipulation\\\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"How to Convert Bash String to Lowercase? [7 Methods]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"name\":\"LinuxSimply\",\"description\":\"All About Linux\",\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxsimply.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\",\"name\":\"LinuxSimply\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"width\":355,\"height\":48,\"caption\":\"LinuxSimply\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/2afb5d809ba746cd33b77eb2639949d7\",\"name\":\"Afia Zahin Oishi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Afia-Zahin-Oishi-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Afia-Zahin-Oishi-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Afia-Zahin-Oishi-II-96x96.png\",\"caption\":\"Afia Zahin Oishi\"},\"description\":\"Assalamualaikum, I am Afia Zahin, completed my graduation in Biomedical Engineering from Bangladesh University of Engineering and Technology, currently working as a Linux Content Developer Executive at SOFTEKO. A high achieving professional with a strong work ethic and able to work in a team in order to consistently achieve my goal and build my skillset. Able to handle difficult problems with patience and swift decision-making. Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/afia.zahin.7796?mibextid=ZbWKwL\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/afia-zahin-oishi-5b4616288\\\/\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/oishi\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Convert Bash String to Lowercase? [7 Methods] - LinuxSimply","description":"Explore the article to learn how to convert bash string to lowercase characters and enhance your knowledge for effective case conversion.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/","og_locale":"en_US","og_type":"article","og_title":"How to Convert Bash String to Lowercase? [7 Methods] - LinuxSimply","og_description":"Explore the article to learn how to convert bash string to lowercase characters and enhance your knowledge for effective case conversion.","og_url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/afia.zahin.7796?mibextid=ZbWKwL","article_published_time":"2024-02-01T07:17:44+00:00","article_modified_time":"2024-03-31T06:13:59+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/lowercase.png","type":"image\/png"}],"author":"Afia Zahin Oishi","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Afia Zahin Oishi","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/"},"author":{"name":"Afia Zahin Oishi","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/2afb5d809ba746cd33b77eb2639949d7"},"headline":"How to Convert Bash String to Lowercase? [7 Methods]","datePublished":"2024-02-01T07:17:44+00:00","dateModified":"2024-03-31T06:13:59+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/"},"wordCount":2039,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/lowercase.png","keywords":["string manipulation"],"articleSection":["Bash Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/","url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/","name":"How to Convert Bash String to Lowercase? [7 Methods] - LinuxSimply","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/lowercase.png","datePublished":"2024-02-01T07:17:44+00:00","dateModified":"2024-03-31T06:13:59+00:00","description":"Explore the article to learn how to convert bash string to lowercase characters and enhance your knowledge for effective case conversion.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/lowercase.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/lowercase.png","width":400,"height":400,"caption":"An overview of converting bash string to lowercase"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/bash-to-lowercase\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxsimply.com\/"},{"@type":"ListItem","position":2,"name":"Bash Scripting Tutorial","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/"},{"@type":"ListItem","position":3,"name":"Bash String","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/"},{"@type":"ListItem","position":4,"name":"String Manipulation in Bash","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/manipulation\/"},{"@type":"ListItem","position":5,"name":"How to Convert Bash String to Lowercase? [7 Methods]"}]},{"@type":"WebSite","@id":"https:\/\/linuxsimply.com\/#website","url":"https:\/\/linuxsimply.com\/","name":"LinuxSimply","description":"All About Linux","publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxsimply.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/linuxsimply.com\/#organization","name":"LinuxSimply","url":"https:\/\/linuxsimply.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","width":355,"height":48,"caption":"LinuxSimply"},"image":{"@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/2afb5d809ba746cd33b77eb2639949d7","name":"Afia Zahin Oishi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Afia-Zahin-Oishi-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Afia-Zahin-Oishi-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Afia-Zahin-Oishi-II-96x96.png","caption":"Afia Zahin Oishi"},"description":"Assalamualaikum, I am Afia Zahin, completed my graduation in Biomedical Engineering from Bangladesh University of Engineering and Technology, currently working as a Linux Content Developer Executive at SOFTEKO. A high achieving professional with a strong work ethic and able to work in a team in order to consistently achieve my goal and build my skillset. Able to handle difficult problems with patience and swift decision-making. Read Full Bio","sameAs":["https:\/\/www.facebook.com\/afia.zahin.7796?mibextid=ZbWKwL","https:\/\/www.linkedin.com\/in\/afia-zahin-oishi-5b4616288\/"],"url":"https:\/\/linuxsimply.com\/author\/oishi\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/35724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/users\/314907"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=35724"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/35724\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/35742"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=35724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=35724"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=35724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}