{"id":35474,"date":"2024-01-30T08:06:19","date_gmt":"2024-01-30T08:06:19","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=35474"},"modified":"2024-04-01T06:33:42","modified_gmt":"2024-04-01T06:33:42","slug":"bash-if-string-equals","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/","title":{"rendered":"Check If A String Equals to Another String in Bash [5 Methods]"},"content":{"rendered":"<p style=\"text-align: justify;\">To check if a string is equal to another string,\u00a0 Bash uses <strong>comparison<\/strong> operators like double equals operator (==), equal (=) operator, or not (!=) operator, <strong>test<\/strong> command, and <strong>case <\/strong>statement.<\/p>\n<p style=\"text-align: justify;\">To check if strings are equal or not, you can use the following 5 methods:<\/p>\n<ol>\n<li>Using equal \u201c=\u201d operator: <code class=\"\" data-line=\"\">[ &quot;$string1&quot; = &quot;$string2&quot; ]<\/code><\/li>\n<li>Using double equal \u201c==\u201d operator: <code class=\"\" data-line=\"\">[ &quot;$string1&quot; == &quot;$string2&quot; ]<\/code><\/li>\n<li>Using not equal operator: \u00a0<code class=\"\" data-line=\"\">[ &quot;$string1&quot; != &quot;$string2&quot; ]<\/code><\/li>\n<li>Using the \u201ctest\u201d command: <code class=\"\" data-line=\"\">test &quot;$string1&quot; = &quot;$string2&quot;<\/code><\/li>\n<li>Using the \u201ccase\u201d statement: <code class=\"\" data-line=\"\">case &quot;$string1&quot; in<\/code><br \/>\n<code class=\"\" data-line=\"\">$string2 )<\/code><\/li>\n<\/ol>\n<p style=\"text-align: justify;\">Let&#8217;s dive into the 5 methods to check string equality in Bash:<\/p>\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\/check-string\/if-string-equals\/#1_Using_Equal_%E2%80%9C%E2%80%9D_Operator\" >1. Using Equal \u201c=\u201d Operator<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#2_Using_Double_Equal_%E2%80%9C%E2%80%9D_Operator\" >2. Using Double Equal \u201c==\u201d Operator<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#3_Using_Not_Equal_%E2%80%9C%E2%80%9D_Operator\" >3. Using Not Equal \u201c!=\u201d Operator<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#4_Using_the_%E2%80%9Ctest%E2%80%9D_Command\" >4. Using the \u201ctest\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#5_Using_%E2%80%9Ccase%E2%80%9D_Statement\" >5. Using \u201ccase\u201d Statement<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#Case_Insensitive_Equality_Check\" >Case Insensitive Equality Check<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#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-9\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#Whats_the_difference_between_the_%E2%80%98_and_the_%E2%80%98-ne_operator\" >What\u2019s the difference between the \u2018!=\u2019 and the \u2018-ne\u2019 operator?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#Whats_the_key_difference_between_%E2%80%9C_%E2%80%9D_and_%E2%80%9C_%E2%80%9D_syntax\" >What\u2019s the key difference between \u201c[[ ]]\u201d and \u201c[ ]\u201d syntax?<\/a><\/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\/check-string\/if-string-equals\/#How_to_check_if_a_string_starts_or_ends_with_a_specific_substring_in_Bash\" >How to check if a string starts or ends with a specific substring in Bash?<\/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\/check-string\/if-string-equals\/#How_can_I_check_if_two_strings_are_equal_in_Bash\" >How can I check if two strings are equal in Bash?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#How_to_compare_two_strings_using_their_length\" >How to compare two strings using their length?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#How_to_check_if_a_string_is_empty_or_not_in_Bash\" >How to check if a string is empty or not in Bash?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"1_Using_Equal_%E2%80%9C%E2%80%9D_Operator\"><\/span>1. Using Equal \u201c=\u201d Operator<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">Bash offers an <strong>equal <\/strong><code class=\"\" data-line=\"\">=<\/code> operator to compare two strings to check their equality. To check if strings are equal, use the <strong>equal operator <\/strong>within the <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if-else\/#more-24071\" target=\"_blank\" rel=\"noopener\"><strong>if-else<\/strong><\/a> statement. If the strings are equal, the condition evaluates <strong>true<\/strong>. Otherwise, the condition evaluates <strong>false.<\/strong><\/p>\n<p style=\"text-align: justify;\">Follow the below script to check if the two strings are equal:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Define two strings\nstring1=&quot;Linuxsimply&quot;\nstring2=&quot;Linuxsimply&quot;\n\n#Print the declared strings\necho &quot;Frist string: $string1&quot;\necho &quot;Second String: $string2&quot;\n\n# Check if string1 is equal to string2\nif [ &quot;$string1&quot; = &quot;$string2&quot; ]; then\necho &quot;Strings are equal.&quot;\nelse\necho &quot;Strings are not equal.&quot;\nfi<\/code><\/pre>\n<p style=\"text-align: justify;\"><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\"> The script starts by defining two string variables <strong>string1 <\/strong>and <strong>string2<\/strong>. Later, <code class=\"\" data-line=\"\">&quot;$string1&quot; = &quot;$string2&quot;<\/code> condition checks whether the value of <strong>string1 <\/strong>is equal to the value of <strong>string2. <\/strong>The equal operator <code class=\"\" data-line=\"\">=<\/code> is used for this equality comparison.<\/div><\/div>\n<p style=\"text-align: justify;\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-35479\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/1-equality-check.png\" alt=\"Check if strings are equal using the equal &quot;=&quot; operator.\" width=\"613\" height=\"137\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/1-equality-check.png 613w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/1-equality-check-300x67.png 300w\" sizes=\"(max-width: 613px) 100vw, 613px\" \/>The output shows that <strong>string1<\/strong> and <strong>string2 <\/strong>are equal after comparing the strings.<\/p>\n<p style=\"text-align: justify;\"><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;\"><strong>Note: <\/strong>To test the equality of two strings, you can also use double square brackets <strong>[[ ]]<\/strong> instead of single square brackets <strong>[ ]<\/strong>.<\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"2_Using_Double_Equal_%E2%80%9C%E2%80%9D_Operator\"><\/span>2. Using Double Equal \u201c==\u201d Operator<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">You can check the equality of two strings using the double equal <code class=\"\" data-line=\"\">==<\/code> operator within an <strong>if <\/strong>statement. Follow the script below to check if two strings are equal using the double equal operator:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Define two strings\nstring1=&quot;Linuxsimply&quot;\nstring2=&quot;Bash&quot;\n\n#Print the declared strings\necho &quot;Frist string: $string1&quot;\necho &quot;Second String: $string2&quot;\n#Check the strings\nif [ &quot;$string1&quot; == &quot;$string2&quot; ]; then\necho &quot;Strings are equal.&quot;\nelse\necho &quot;Strings are not equal.&quot;\nfi<\/code><\/pre>\n<p style=\"text-align: justify;\"><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;\">Here, <code class=\"\" data-line=\"\">&quot;$string1&quot; == &quot;$string2&quot;<\/code> condition returns <strong>true <\/strong>if it finds the <strong>string1 <\/strong>and <strong>string2<\/strong> equal. If the strings are different then the condition returns <strong>False.<\/strong><\/div><\/div><img decoding=\"async\" class=\"aligncenter wp-image-35480 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/2-using-double-equal-operator.png\" alt=\"Check Bash if string equals using double equal &quot;==&quot; operator.\" width=\"617\" height=\"140\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/2-using-double-equal-operator.png 617w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/2-using-double-equal-operator-300x68.png 300w\" sizes=\"(max-width: 617px) 100vw, 617px\" \/>The output shows that \u201cstrings are not equal\u201d as the script finds <strong>string1 <\/strong>and <strong>string2 <\/strong>different after comparing.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_Using_Not_Equal_%E2%80%9C%E2%80%9D_Operator\"><\/span>3. Using Not Equal \u201c!=\u201d Operator<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">In Bash, the <strong>not-equal<\/strong> operator examines whether the entities being compared are different. In Bash, the not equal <code class=\"\" data-line=\"\">!=<\/code> operator along with the <strong>if-else <\/strong>statement can check if two strings are equal. When the strings are not equal, the condition is <strong>true<\/strong>; otherwise, it is <strong>false<\/strong>.<\/p>\n<p style=\"text-align: justify;\">To check the string\u2019s equality using not equal operator, follow the script below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Define two strings\nstring1=&quot;Linux&quot;\nstring2=&quot;linux&quot;\n\n#Print the declared strings\necho &quot;Frist string: $string1&quot;\necho &quot;Second String: $string2&quot;\n\n#check the string&#039;s equality\nif [ &quot;$string1&quot; != &quot;$string2&quot; ]; then\necho &quot;Strings are not Equal.&quot;\nelse\necho &quot;Strings are Equal.&quot;\nfi<\/code><\/pre>\n<p style=\"text-align: justify;\"><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\"> Here, \u00a0<code class=\"\" data-line=\"\">&quot;$string1&quot; != &quot;$string2&quot;<\/code> condition checks whether the value of <strong>string1 <\/strong>is not equal to the value of <strong>string2. <\/strong>If <strong>string1 <\/strong>becomes different from <strong>string2<\/strong>, the condition evaluates <strong>true <\/strong>and executes the <code class=\"\" data-line=\"\">echo &quot;Strings are not Equal.&quot;<\/code>. Otherwise, it evaluates <strong>false <\/strong>and executes <code class=\"\" data-line=\"\">echo &quot;Strings are Equal.&quot;<\/code>.<\/div><\/div><img decoding=\"async\" class=\"aligncenter wp-image-35481 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/3-not-equal-operator.png\" alt=\"Using not equal &quot;!=&quot; operator to check Bash if string equals .\" width=\"690\" height=\"143\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/3-not-equal-operator.png 690w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/3-not-equal-operator-300x62.png 300w\" sizes=\"(max-width: 690px) 100vw, 690px\" \/>The output shows that the \u201cStrings are not equal\u201d after checking the strings using the not equal operator.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"4_Using_the_%E2%80%9Ctest%E2%80%9D_Command\"><\/span>4. Using the \u201ctest\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">In Bash, you can compare two strings to check equality using the <strong>test<\/strong> command instead of using <strong>[ ] <\/strong>or <strong>[[ ]]<\/strong>. Follow the script below to check if the strings are equal:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Define two strings\nstring1=&quot;LinuxSimply&quot;\nstring2=&quot;Linux&quot;\n\n#Print the declared strings\necho &quot;Frist string: $string1&quot;\necho &quot;Second String: $string2&quot;\n\n#check two strings equality\nif test &quot;$string1&quot; = &quot;$string2&quot;; then\necho &quot;Strings are equal.&quot;\nelse\necho &quot;Strings are not equal.&quot;\nfi<\/code><\/pre>\n<p style=\"text-align: justify;\"><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\"> Initially, the script defines two different strings, <strong>string1 <\/strong> and <strong>string2.<\/strong> After that, the snippet <code class=\"\" data-line=\"\">if test &quot;$string&quot; = &quot;$string2&quot;<\/code> statement checks whether <strong>string1 <\/strong>and <strong>string2 <\/strong>are equal using the <strong>test <\/strong>command within the <strong>if <\/strong>statement<strong>.<\/strong> The <strong>test <\/strong> command evaluates the expression.<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-35482 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/4-using-test-command.png\" alt=\"Check Bash if string equals using &quot;test&quot; command.\" width=\"596\" height=\"139\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/4-using-test-command.png 596w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/4-using-test-command-300x70.png 300w\" sizes=\"(max-width: 596px) 100vw, 596px\" \/>The output shows the result after checking the equality of\u00a0 <strong>string1 <\/strong>and <strong>string2 <\/strong>using the <strong>test <\/strong>command.<\/p>\n<p style=\"text-align: justify;\">To check if two strings are equal in one line, use the <strong>test <\/strong>command with the equal <code class=\"\" data-line=\"\">=<\/code> operator and conditional operator (<strong><a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/operator\/logical-operators\/and\/\" target=\"_blank\" rel=\"noopener\">&amp;&amp;<\/a>, <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/operator\/logical-operators\/or\/\" target=\"_blank\" rel=\"noopener\">||<\/a><\/strong>). Follow the script below to check string equality in one line:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">test &quot;LinuxSimply&quot; = &quot;LiNUXsimply&quot; &amp;&amp; echo &quot;Strings are equal.&quot; || echo &quot;Strings are not equal.&quot;<\/code><\/pre>\n<p style=\"text-align: justify;\"><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\">Here, the preceding command <code class=\"\" data-line=\"\">test \u201cLinuxSimply\u201d = \u201cLiNUXsimply\u201d<\/code> checks if the two strings are equal. If the preceding command succeeds and returns <strong>true, <\/strong>the command after the <code class=\"\" data-line=\"\">&amp;&amp;<\/code> operator (<strong>echo \u201cstrings are equal\u201d) <\/strong>will execute. If the preceding command fails and returns <strong>false<\/strong>, the command after the <code class=\"\" data-line=\"\">||<\/code> operator (<strong>echo \u201cStrings are not equal\u201d<\/strong>) will execute.<\/div><\/div>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-35483 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/5-using-test-command-in-one-line.png\" alt=\"Check Bash if string equals in on line using test command, and &quot;&amp;&amp;&quot; and or &quot;||&quot; operator.\" width=\"825\" height=\"171\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/5-using-test-command-in-one-line.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/5-using-test-command-in-one-line-300x62.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/5-using-test-command-in-one-line-768x159.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>The output shows the result after checking two strings\u2019 equality using the \u201ctest\u201d command in one line.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"5_Using_%E2%80%9Ccase%E2%80%9D_Statement\"><\/span>5. Using \u201ccase\u201d Statement<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">In Bash, the <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/case\/#more-28809\" target=\"_blank\" rel=\"noopener\"><strong>case statement<\/strong><\/a> allows for conditional branching based on the value of a variable. It evaluates the variable against different patterns and executes the code block associated with the first matching pattern. You can use a <strong>case statement<\/strong> in Bash to check strings for equality. Follow the script below to check if the two strings are equal:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Define two strings\nstring1=&quot;Linux&quot;\nstring2=&quot;LinuxSimply&quot;\n\n#Print the declared strings\necho &quot;Frist string: $string1&quot;\necho &quot;Second String: $string2&quot;\n\n#Check the strings\ncase &quot;$string1&quot; in\n$string2 )\necho &quot;Strings are equal&quot;\n;;\n*)\necho &quot;Strings are not equal.&quot;\n;;\nesac<\/code><\/pre>\n<p style=\"text-align: justify;\"><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\">If <strong>string1<\/strong> is equal to <strong>string2<\/strong>, it will execute the first block and print &#8220;Strings are equal.&#8221; Otherwise, it will fall through to the <strong>wildcard\u00a0<\/strong>(*) case and print &#8220;Strings are not equal.<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-35484 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/6-using-case-statement.png\" alt=\"Check Bash if string equals using the &quot;case&quot; statement.\" width=\"618\" height=\"134\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/6-using-case-statement.png 618w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/6-using-case-statement-300x65.png 300w\" sizes=\"(max-width: 618px) 100vw, 618px\" \/>The output shows that \u201cStrings are not equal\u201d<strong>.<\/strong><\/p>\n<p style=\"text-align: justify;\"><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>So far<strong>, <\/strong>the 5 methods discussed in this article, all check strings\u2019 equality in a case-sensitive manner.<\/div><\/div>\n<p style=\"text-align: justify;\">In the following section, I&#8217;ll explain approaches for performing equality checks without considering the case of the characters involved.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Case_Insensitive_Equality_Check\"><\/span>Case Insensitive Equality Check<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">To check the case-insensitive equality of strings, you can convert the strings into lowercase (using <code class=\"\" data-line=\"\">,,<\/code>) or uppercase (using <code class=\"\" data-line=\"\">^^<\/code><strong>) <\/strong>or use the <code class=\"\" data-line=\"\">nocasematch<\/code> option and after that compare them to check their equality. In this section 3 ways have been discussed to check string in a case-insensitive manner.<\/p>\n<p><span style=\"color: #008000; font-size: 14pt;\"><strong>1. Lowercase Conversion: <\/strong><\/span><span style=\"color: #000000;\">To c<\/span>onvert the string\u2019s case into lowercase and check their equality as below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Define two strings\nstring1=&quot;LinuxSimply&quot;\nstring2=&quot;linuxsiMpLy&quot;\n#Print the declared strings\necho &quot;Frist string: $string1&quot;\necho &quot;Second String: $string2&quot;\n\n#Convert the strings into lowercase\nstring1=${string1,,}\nstring2=${string2,,}\n\n#Print the declared strings\necho &quot;The strings after converting into lowercase&quot;\necho &quot;Frist string: $string1&quot;\necho &quot;Second String: $string2&quot;\n\n#compare the strings\nif [[ $string1 == $string2 ]]; then\necho &quot;The strings are equal.&quot;\nelse\necho &quot;The strings are not equal.&quot;\nfi<\/code><\/pre>\n<p style=\"text-align: justify;\"><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\">Here, <code class=\"\" data-line=\"\">${string1,,}<\/code> and <code class=\"\" data-line=\"\">${string2,,}<\/code> are used to convert the strings to lowercase using the comma <code class=\"\" data-line=\"\">,<\/code> operator inside the double square brackets <code class=\"\" data-line=\"\">[[ ]]<\/code>.<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-35485\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/7-case-insensitive-lowercase.png\" alt=\"Check strings' equality in case insensitive manner by converting the strings into lower case.\" width=\"700\" height=\"215\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/7-case-insensitive-lowercase.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/7-case-insensitive-lowercase-300x92.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>The output shows that the strings are equal without considering the cases of the string.<\/p>\n<p><span style=\"color: #008000; font-size: 14pt;\"><strong>2. Uppercase Conversion: <\/strong><\/span>To convert both strings in uppercase and compare them. Check the script below to check the equality of two strings:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Define two strings\nstring1=&quot;LinuxSimply&quot;\nstring2=&quot;linuxsiMpLy&quot;\n\n#Print the declared strings\necho &quot;Frist string: $string1&quot;\necho &quot;Second String: $string2&quot;\n\n#Convert the strings into uppercase\nstring1=${string1^^}\nstring2=${string2^^}\n\n#Print the declared strings\necho &quot;The strings converted into uppercase&quot;\necho &quot;Frist string: $string1&quot;\necho &quot;Second String: $string2&quot;\n\n#compare the strings\nif [[ $string1 == $string2 ]]; then\necho &quot;The strings are equal.&quot;\nelse\necho &quot;The strings are not equal.&quot;\nfi<\/code><\/pre>\n<p style=\"text-align: justify;\"><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\">Here, the <code class=\"\" data-line=\"\">${string1^^}<\/code> and <code class=\"\" data-line=\"\">${string2^^}<\/code> expressions are used to convert the strings to uppercase. This is done by using <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/expansion\/parameter-expansion\/\" target=\"_blank\" rel=\"noopener\"><strong>parameter expansion<\/strong><\/a> with <code class=\"\" data-line=\"\">^^<\/code>.<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-35486\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/8-case-insensitive-uppercase.png\" alt=\"Check case insensitive string equality by converting the strings in uppercase.\" width=\"681\" height=\"233\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/8-case-insensitive-uppercase.png 681w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/8-case-insensitive-uppercase-300x103.png 300w\" sizes=\"(max-width: 681px) 100vw, 681px\" \/>The output shows that \u201cThe strings are equal\u201d after comparing the uppercase converted strings.<\/p>\n<p><span style=\"color: #008000; font-size: 14pt;\"><strong>3. Using &#8220;nocasematch&#8221; Option: <\/strong><\/span>Bash provides the <code class=\"\" data-line=\"\">nocasematch<\/code> option to check the strings\u2019 equality in a case-insensitive manner. To check string equality in case insensitive manner, follow the script below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Define two strings\nstring1=&quot;Linux&quot;\nstring2=&quot;LinuxSimply&quot;\n\n#Print the declared strings\necho &quot;Frist string: $string1&quot;\necho &quot;Second String: $string2&quot;\n\nshopt -s nocasematch\n\n#Check the strings\ncase &quot;$string1&quot; in\n$string2 )\necho &quot;Strings are equal&quot;\n;;\n*)\necho &quot;Strings are not equal.&quot;\n;;\nesac<\/code><\/pre>\n<p style=\"text-align: justify;\"><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\">Here, <code class=\"\" data-line=\"\">shopt -s nocasematch<\/code> is used to set the <code class=\"\" data-line=\"\">nocasematch<\/code> option, which makes the subsequent string comparisons in the script case-insensitive.<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-35487\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/9-case-insensitive-noncasematch.png\" alt=\"Check case insensitive string equality using &quot;nocasematch&quot; option.\" width=\"666\" height=\"135\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/9-case-insensitive-noncasematch.png 666w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/9-case-insensitive-noncasematch-300x61.png 300w\" sizes=\"(max-width: 666px) 100vw, 666px\" \/>The output shows the strings are equal in a case-insensitive manner.<\/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, this article has illustrated 5 methods in detail, including the case-insensitive approach. Employing appropriate comparison techniques, such as using the <strong>==<\/strong> operator or the <strong>!= <\/strong>operator with double brackets and employing the <strong>[[ &#8230; ]]<\/strong> construct, allows for effective string equality checks in Bash scripts. Hope this guide will help to sharpen your knowledge of the equality check of strings in Bash.<\/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=\"Whats_the_difference_between_the_%E2%80%98_and_the_%E2%80%98-ne_operator\"><\/span>What\u2019s the difference between the \u2018!=\u2019 and the \u2018-ne\u2019 operator?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In Bash, the <code class=\"\" data-line=\"\">!=<\/code> operator is used for string comparison whereas the <code class=\"\" data-line=\"\">-ne<\/code> operator is used for only numerical comparison. When considering which operator to use, you have to consider the type of values you are comparing.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Whats_the_key_difference_between_%E2%80%9C_%E2%80%9D_and_%E2%80%9C_%E2%80%9D_syntax\"><\/span>What\u2019s the key difference between \u201c[[ ]]\u201d and \u201c[ ]\u201d syntax?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The key difference between <code class=\"\" data-line=\"\">[[ ]]<\/code> and <code class=\"\" data-line=\"\">[ ]<\/code> syntax in Bash is that \u2018<strong>[[ ]]<\/strong>\u2019 is a modern and flexible conditional construct. It supports advanced string comparisons, pattern matching, and logical operators, while \u2018<strong>[ ]<\/strong>\u2019 is a traditional <strong>test <\/strong>command with more limited functionality.<strong> [[ ]]<\/strong> is generally recommended for conditional expressions in modern Bash scripts.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_check_if_a_string_starts_or_ends_with_a_specific_substring_in_Bash\"><\/span>How to check if a string starts or ends with a specific substring in Bash?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To check if a string starts or ends with a specific substring, use the <strong>[[ ]]\u00a0 <\/strong>construct with the <code class=\"\" data-line=\"\">==<\/code> operator and the appropriate wildcard characters (* and ?). Here is an example\u00a0 bash script for checking the start and end of a string:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\nstring=&quot;Hello, World!&quot;\n\n#Checking if the string starts with &quot;Hello&quot;\nif [[ &quot;$string&quot; == &quot;Hello&quot;* ]]; then\necho &quot;The string starts with &#039;Hello&#039;.&quot;\nfi\n\n#Checking if the string ends with &quot;HWorld!&quot;\nif [[ &quot;$string&quot; == *&quot;World!&quot; ]]; then\necho &quot;The string ends with &#039;World!&#039;.&quot;\nfi\n##Output\nThe string starts with &#039;Hello&#039;.\nThe string ends with &#039;World!&#039;.<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"How_can_I_check_if_two_strings_are_equal_in_Bash\"><\/span>How can I check if two strings are equal in Bash?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To check if two strings are equal in Bash, use the\u00a0<strong>equal\u00a0<\/strong>(=) operator to compare the strings. For example, if two strings are\u00a0<strong>string1<\/strong> and\u00a0<strong>string2,\u00a0<\/strong> the syntax will be <code class=\"\" data-line=\"\">if [string1=string2]<\/code> to compare the strings. If the two strings are equal the condition returns\u00a0<strong>true<\/strong>, on the contrary, it returns <strong>false.\u00a0<\/strong>This is how you can check if two strings are equal in Bash.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_compare_two_strings_using_their_length\"><\/span>How to compare two strings using their length?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To compare two strings using their length, use the parameter expansion expression <code class=\"\" data-line=\"\">${#string}<\/code> to determine the length of the strings and compare the strings using the <strong>If statement. <\/strong>The syntax to compare two strings using their length is\u00a0<code class=\"\" data-line=\"\">if [ ${#string1}=${#string2} ]<\/code>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_check_if_a_string_is_empty_or_not_in_Bash\"><\/span>How to check if a string is empty or not in Bash?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To check if a string is empty or not, use the <code class=\"\" data-line=\"\">-z<\/code> option within the <strong>if-else <\/strong>statement.\u00a0 Follow the script below to check for an empty string:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#initializing empty string\nstring=&quot;&quot;\n\n#Checking if the string is empty\nif [[ -z &quot;$string&quot; ]]; then\necho &quot;The string is empty.&quot;\nelse\necho &quot;The string is not empty.&quot;\nfi\n\n##Output\nThe string is empty.<\/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\": \"What\u2019s the difference between the \u2018!=\u2019 and the \u2018-ne\u2019 operator?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"In Bash, the != operator is used for string comparison whereas the -ne operator is used for only numerical comparison. When considering which operator to use, you have to consider the type of values you are comparing.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"What\u2019s the key difference between \u201c[[ ]]\u201d and \u201c[ ]\u201d syntax?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"The key difference between [[ ]] and [ ] syntax in Bash is that \u2018[[ ]]\u2019 is a modern and flexible conditional construct. It supports advanced string comparisons, pattern matching, and logical operators, while \u2018[ ]\u2019 is a traditional test command with more limited functionality. [[ ]] is generally recommended for conditional expressions in modern Bash scripts.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How can I check if two strings are equal in Bash?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"To check if two strings are equal in Bash, use the\u00a0equal\u00a0(=) operator to compare the strings. For example, if two strings are\u00a0string1 and\u00a0string2,\u00a0 the syntax will be if [string1=string2] to compare the strings. If the two strings are equal the condition returns\u00a0true, on the contrary, it returns false.\u00a0This is how you can check if two strings are equal in Bash.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How to compare two strings using their length?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"To compare two strings using their length, use the parameter expansion expression ${#string} to determine the length of the strings and compare the strings using the If statement. The syntax to compare two strings using their length is\u00a0if [ ${#string1}=${#string2} ].\"\n    }\n  }]\n}\n<\/script><br \/>\n<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\/check-string\/check-if-string-starts-with\/\" target=\"_blank\" rel=\"noopener\">Check If Bash String Starts with Some Value [4 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;Check String 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\/check-string\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/\" target=\"_blank\" rel=\"noopener\">Check String 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;35474&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;Check If A String Equals to Another String in Bash [5 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>To check if a string is equal to another string,\u00a0 Bash uses comparison operators like double equals operator (==), equal &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Check If A String Equals to Another String in Bash [5 Methods]\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#more-35474\" aria-label=\"Read more about Check If A String Equals to Another String in Bash [5 Methods]\">Read more<\/a><\/p>\n","protected":false},"author":314912,"featured_media":35489,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[196],"class_list":["post-35474","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash-scripting","tag-check-string","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>Check If A String Equals to Another String in Bash [5 Methods] - LinuxSimply<\/title>\n<meta name=\"description\" content=\"In Bash, to check if a string equals another string use approaches that include using equal, double equal, not equal operators, and more.\" \/>\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\/check-string\/if-string-equals\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Check If A String Equals to Another String in Bash [5 Methods] - LinuxSimply\" \/>\n<meta property=\"og:description\" content=\"In Bash, to check if a string equals another string use approaches that include using equal, double equal, not equal operators, and more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/profile.php?id=100077694755838&amp;mibextid=ZbWKwL\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-30T08:06:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-01T06:33:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/Feature-image-.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=\"Auhona Islam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Auhona Islam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 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\\\/check-string\\\/if-string-equals\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/check-string\\\/if-string-equals\\\/\"},\"author\":{\"name\":\"Auhona Islam\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/25a3d16db4655804617c9e0c4a7989fb\"},\"headline\":\"Check If A String Equals to Another String in Bash [5 Methods]\",\"datePublished\":\"2024-01-30T08:06:19+00:00\",\"dateModified\":\"2024-04-01T06:33:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/check-string\\\/if-string-equals\\\/\"},\"wordCount\":1483,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/check-string\\\/if-string-equals\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/Feature-image-.png\",\"keywords\":[\"check string\"],\"articleSection\":[\"Bash Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/check-string\\\/if-string-equals\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/check-string\\\/if-string-equals\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/check-string\\\/if-string-equals\\\/\",\"name\":\"Check If A String Equals to Another String in Bash [5 Methods] - LinuxSimply\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/check-string\\\/if-string-equals\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/check-string\\\/if-string-equals\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/Feature-image-.png\",\"datePublished\":\"2024-01-30T08:06:19+00:00\",\"dateModified\":\"2024-04-01T06:33:42+00:00\",\"description\":\"In Bash, to check if a string equals another string use approaches that include using equal, double equal, not equal operators, and more.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/check-string\\\/if-string-equals\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/check-string\\\/if-string-equals\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/check-string\\\/if-string-equals\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/Feature-image-.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/Feature-image-.png\",\"width\":400,\"height\":400,\"caption\":\"Bash check if strings are equal.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/check-string\\\/if-string-equals\\\/#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\":\"Check String in Bash\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/check-string\\\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Check If A String Equals to Another String in Bash [5 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\\\/25a3d16db4655804617c9e0c4a7989fb\",\"name\":\"Auhona Islam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Auhona-Islam-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Auhona-Islam-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Auhona-Islam-II-96x96.png\",\"caption\":\"Auhona Islam\"},\"description\":\"Auhona Islam is a dedicated professional with a background in Electronics and Communication Engineering (ECE) from Khulna University of Engineering &amp; Technology. Graduating in 2023, Auhona is currently excelling in her role as a Linux content developer executive at SOFTEKO to provide a more straightforward route for Linux users. She aims to generate compelling materials for Linux users with her knowledge and skills. She holds her enthusiasm in the realm of Machine Learning (ML), Deep Learning (DL), and Artificial Intelligence (AI). Apart from these, she has a passion for playing instruments and singing. Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/profile.php?id=100077694755838&mibextid=ZbWKwL\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/auhona-islam-429822208\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/auhona\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Check If A String Equals to Another String in Bash [5 Methods] - LinuxSimply","description":"In Bash, to check if a string equals another string use approaches that include using equal, double equal, not equal operators, and more.","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\/check-string\/if-string-equals\/","og_locale":"en_US","og_type":"article","og_title":"Check If A String Equals to Another String in Bash [5 Methods] - LinuxSimply","og_description":"In Bash, to check if a string equals another string use approaches that include using equal, double equal, not equal operators, and more.","og_url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/profile.php?id=100077694755838&mibextid=ZbWKwL","article_published_time":"2024-01-30T08:06:19+00:00","article_modified_time":"2024-04-01T06:33:42+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/Feature-image-.png","type":"image\/png"}],"author":"Auhona Islam","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Auhona Islam","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/"},"author":{"name":"Auhona Islam","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/25a3d16db4655804617c9e0c4a7989fb"},"headline":"Check If A String Equals to Another String in Bash [5 Methods]","datePublished":"2024-01-30T08:06:19+00:00","dateModified":"2024-04-01T06:33:42+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/"},"wordCount":1483,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/Feature-image-.png","keywords":["check string"],"articleSection":["Bash Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/","url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/","name":"Check If A String Equals to Another String in Bash [5 Methods] - LinuxSimply","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/Feature-image-.png","datePublished":"2024-01-30T08:06:19+00:00","dateModified":"2024-04-01T06:33:42+00:00","description":"In Bash, to check if a string equals another string use approaches that include using equal, double equal, not equal operators, and more.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/Feature-image-.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/01\/Feature-image-.png","width":400,"height":400,"caption":"Bash check if strings are equal."},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/if-string-equals\/#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":"Check String in Bash","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/check-string\/"},{"@type":"ListItem","position":5,"name":"Check If A String Equals to Another String in Bash [5 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\/25a3d16db4655804617c9e0c4a7989fb","name":"Auhona Islam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Auhona-Islam-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Auhona-Islam-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Auhona-Islam-II-96x96.png","caption":"Auhona Islam"},"description":"Auhona Islam is a dedicated professional with a background in Electronics and Communication Engineering (ECE) from Khulna University of Engineering &amp; Technology. Graduating in 2023, Auhona is currently excelling in her role as a Linux content developer executive at SOFTEKO to provide a more straightforward route for Linux users. She aims to generate compelling materials for Linux users with her knowledge and skills. She holds her enthusiasm in the realm of Machine Learning (ML), Deep Learning (DL), and Artificial Intelligence (AI). Apart from these, she has a passion for playing instruments and singing. Read Full Bio","sameAs":["https:\/\/www.facebook.com\/profile.php?id=100077694755838&mibextid=ZbWKwL","https:\/\/www.linkedin.com\/in\/auhona-islam-429822208"],"url":"https:\/\/linuxsimply.com\/author\/auhona\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/35474","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\/314912"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=35474"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/35474\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/35489"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=35474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=35474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=35474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}