{"id":26859,"date":"2023-11-12T12:07:48","date_gmt":"2023-11-12T12:07:48","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=26859"},"modified":"2024-05-09T11:33:59","modified_gmt":"2024-05-09T11:33:59","slug":"bash-if-test","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/","title":{"rendered":"Bash Test Operations in \u2018If\u2019 Statement"},"content":{"rendered":"<p style=\"text-align: justify;\">Bash test operation is a prominent way to use the built-in \u201ctest\u201d command or the equivalent operator <strong>[ ]<\/strong> (square brackets) to check the validity of a conditional expression by returning exit status like <strong>0 for (True\/Success)<\/strong> and <strong>1 for (False\/Failure)<\/strong>.<\/p>\n<div class=\"su-button-center\"><a href=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/Practice-Files_Bash-if-Test.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 of Bash Test Operations in \u2018if\u2019 Statement<\/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\/conditional-statements\/if\/if-test\/#Performing_Test_Operations_in_%E2%80%98If_Conditionals_in_Bash\" >Performing Test Operations in \u2018If\u2019 Conditionals in Bash<\/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\/conditional-statements\/if\/if-test\/#Bash_%E2%80%98if_Conditional_Test_for_Numerical_Comparison\" >Bash \u2018if\u2019 Conditional Test for Numerical Comparison<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#1_Equality_Comparison_Using_%E2%80%9C-eq%E2%80%9D\" >1. Equality Comparison Using \u201c-eq\u201d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#2_Inequality_Comparison_Using_%E2%80%9C-ne%E2%80%9D\" >2. Inequality Comparison Using \u201c-ne\u201d<\/a><\/li><\/ul><\/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\/conditional-statements\/if\/if-test\/#Bash_%E2%80%98if_Conditional_Test_for_String_Comparison\" >Bash \u2018if\u2019 Conditional Test for String Comparison<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#1_Checking_Null_String_Using_%E2%80%9C-z%E2%80%9D\" >1. Checking Null String Using \u201c-z\u201d<\/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\/conditional-statements\/if\/if-test\/#2_Checking_Non-empty_String_Using_%E2%80%9C-n%E2%80%9D\" >2. Checking Non-empty String Using \u201c-n\u201d<\/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\/conditional-statements\/if\/if-test\/#3_Equality_Checking_Using_%E2%80%9C%E2%80%9D\" >3. Equality Checking Using \u201c=\u201d<\/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\/conditional-statements\/if\/if-test\/#4_Inequality_Checking_Using_%E2%80%9C%E2%80%9D\" >4. Inequality Checking Using \u201c!=\u201d<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#Bash_%E2%80%98if_Conditional_Test_for_File_Directory_Comparisons\" >Bash \u2018if\u2019 Conditional Test for File &amp; Directory Comparisons<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#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-13\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#Is_there_a_shorthand_for_combining_conditions_in_an_%E2%80%98if_statement_using_the_%E2%80%98test_command\" >Is there a shorthand for combining conditions in an \u2018if\u2019 statement using the \u2018test\u2019 command?<\/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\/conditional-statements\/if\/if-test\/#Is_there_any_difference_between_the_and_operators_in_the_%E2%80%98test_command_when_comparing_strings_in_an_%E2%80%98if_statement\" >Is there any difference between the = and == operators in the \u2018test\u2019 command when comparing strings in an \u2018if\u2019 statement?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#How_to_If_a_string_starts_with_a_specific_prefix_using_the_%E2%80%98test_command_in_an_%E2%80%98if_statement\" >How to If a string starts with a specific prefix using the \u2018test\u2019 command in an \u2018if\u2019 statement?<\/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\/conditional-statements\/if\/if-test\/#Is_there_a_way_to_check_If_a_string_ends_with_a_specific_suffix_using_the_%E2%80%98test_command_in_an_%E2%80%98if_statement\" >Is there a way to check If a string ends with a specific suffix using the \u2018test\u2019 command in an \u2018if\u2019 statement?<\/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\/conditional-statements\/if\/if-test\/#Can_I_use_wildcard_patterns_with_the_%E2%80%98test_command_in_an_%E2%80%98if_statement_to_match_filenames\" >Can I use wildcard patterns with the \u2018test\u2019 command in an \u2018if\u2019 statement to match filenames?<\/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\/conditional-statements\/if\/if-test\/#How_to_test_If_a_command_is_running\" >How to test If a command is running?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Performing_Test_Operations_in_%E2%80%98If_Conditionals_in_Bash\"><\/span>Performing Test Operations in \u2018If\u2019 Conditionals in Bash<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">The test command performs checks and makes decisions in different conditional cases such as <strong>numerical comparisons<\/strong>, <strong>string comparisons<\/strong>, <strong>file comparisons<\/strong>, etc. Following are <strong>3<\/strong> different schemes of Bash conditional tests.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Bash_%E2%80%98if_Conditional_Test_for_Numerical_Comparison\"><\/span>Bash \u2018if\u2019 Conditional Test for Numerical Comparison<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">Numerical comparison in Bash means comparing two numbers or numeric variables. However, conditional test operators that can be used for numerical comparison within the test command are: \u201c-eq (equal)\u201d, \u201c-ne (not equal)\u201d, \u201c-gt (greater than)\u201d, \u201c-lt (less than)\u201d, \u2018-ge (greater than or equal)\u201d, \u201c-le (less than or equal)\u201d.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_Equality_Comparison_Using_%E2%80%9C-eq%E2%80%9D\"><\/span>1. Equality Comparison Using \u201c-eq\u201d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The \u201c-eq\u201d is an operator that checks if two numbers are equal. The line <code class=\"\" data-line=\"\">if [ &quot;$num1&quot; -eq &quot;$num2&quot; ]<\/code> returns True if the $num1 and $num2 are equal. The script below shows the use of it:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Declaring two numbers\nnum1=6\nnum2=6\n\n#Checking if the numbers are equal\nif [ &quot;$num1&quot; -eq &quot;$num2&quot; ]; then\n\u00a0 echo &quot;Equal Numbers&quot;\nfi<\/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\"> The script declares two variables <strong>num1 <\/strong>and <strong>num2<\/strong>. Then, it checks if the two numbers are equal using <strong>\u2018[ ]\u2019<\/strong> within the <strong>\u2018if\u2019 <\/strong>statement and echoes the specific output using the <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/output\/echo-command\/\" target=\"_blank\" rel=\"noopener\"><strong>echo command<\/strong><\/a>. <\/div><\/div>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-26875\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img1-Two-equal-numbers-checking-using-test-command.png\" alt=\"Two equal numbers checking using 'test' command\" width=\"699\" height=\"190\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img1-Two-equal-numbers-checking-using-test-command.png 699w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img1-Two-equal-numbers-checking-using-test-command-300x82.png 300w\" sizes=\"(max-width: 699px) 100vw, 699px\" \/><\/p>\n<p style=\"text-align: justify;\">This output states that the inserted two numbers make the \u2018if\u2019 condition true and print <strong>\u201cEqual Numbers\u201d<\/strong>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Inequality_Comparison_Using_%E2%80%9C-ne%E2%80%9D\"><\/span>2. Inequality Comparison Using \u201c-ne\u201d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The \u201c-ne\u201d is an operator that checks if two numbers are not equal. So, to check whether the inserted two numbers are not equal, use the syntax <code class=\"\" data-line=\"\">if [ &quot;$num1&quot; -ne &quot;$num2&quot; ]<\/code>. Following is an example to check if two numbers are not equal:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Declaring two numbers\nnum1=25\nnum2=5\n\n#Checking if the numbers are not equal\nif [ &quot;$num1&quot; -ne &quot;$num2&quot; ]; then\n\u00a0 echo &quot;Not-equal Numbers&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 script first declares two variables <strong>num1 <\/strong>and <strong>num2<\/strong>. Then, it checks if the two numbers are not equal using <strong>\u2018[ ]\u2019<\/strong> within the \u2018if\u2019 statement and displays the output using the <strong>echo command<\/strong>. <\/div><\/div>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-26876\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img2-Checking-if-two-numbers-are-not-equal-using-test-command.png\" alt=\"Checking if two numbers are not equal using 'test' command\" width=\"700\" height=\"161\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img2-Checking-if-two-numbers-are-not-equal-using-test-command.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img2-Checking-if-two-numbers-are-not-equal-using-test-command-300x69.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p style=\"text-align: justify;\">The above image depicts that the script successfully satisfies the condition and displays <strong>\u201cNot-equal Numbers\u201d<\/strong>.<\/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;\">Similarly, you can use the operators \u201c-gt\u201d, \u201c-lt\u201d, \u2018-ge\u201d, \u201c-le\u201d and perform conditional test operations respectively.<\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Bash_%E2%80%98if_Conditional_Test_for_String_Comparison\"><\/span>Bash \u2018if\u2019 Conditional Test for String Comparison<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">When working with Bash scripts, sometimes you may need to compare strings in cases of equality, inequality, sorting and so on. In this effort, you can use these <strong>string comparison operators<\/strong> \u201c= (equal)\u201d, \u201c!= (not equal)\u201d, \u201c&gt; (greater than)\u201d, \u201c&lt; (less than)\u201d, \u201c&gt;= (greater than or equal)\u201d, \u201c&lt;= (less than or equal)\u201d within the test command.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_Checking_Null_String_Using_%E2%80%9C-z%E2%80%9D\"><\/span>1. Checking Null String Using \u201c-z\u201d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The \u201c-z\u201d is an operator that checks if a string is empty (zero length). If the condition <code class=\"\" data-line=\"\">[ -z &quot;$string&quot; ]<\/code> within an \u201cif\u201d block is satisfied, it returns 0 (success) and executes the code of that block. Here is a detailed example:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Defining a string\nstring=&quot;&quot;\n\n#Checking if the string is empty\nif [ -z &quot;$string&quot; ]; then\n\u00a0 echo &quot;Empty String&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\"> First, the script defines a variable <strong>string<\/strong>. Then it checks if the string has zero length using the \u201c-z\u201d operator in the \u2018[ ]\u2019 command and displays the output \u201cEmpty String\u201d. <\/div><\/div>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-26877\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img3-Checking-if-the-string-is-empty-using-test-command.png\" alt=\"Checking if the string is empty using 'test' command\" width=\"700\" height=\"172\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img3-Checking-if-the-string-is-empty-using-test-command.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img3-Checking-if-the-string-is-empty-using-test-command-300x74.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p style=\"text-align: justify;\">From the above image, you can see that the declared variable <strong>string <\/strong>contains zero-length which means the string is empty.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Checking_Non-empty_String_Using_%E2%80%9C-n%E2%80%9D\"><\/span>2. Checking Non-empty String Using \u201c-n\u201d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The \u201c-n\u201d is an operator that checks whether a string is non-empty (non-zero length). And this is done by using the syntax <code class=\"\" data-line=\"\">if [ -n &quot;$string&quot; ]<\/code>. For instance:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Defining a string\nstring=&quot;Hello, Linux!&quot;\n\n#Checking if the string is not empty\nif [ -n &quot;$string&quot; ]; then\n\u00a0 echo &quot;Not Empty String&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\"> This script first defines a string and then checks if the string has a non-zero length using the <b>&#8216;<\/b>-n<b>&#8216;<\/b> operator and displays &#8220;Not Empty String&#8221;. <\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-26879\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img4-Checking-if-the-string-is-not-empty-using-test-command.png\" alt=\"Checking if the string is not empty using 'test' command\" width=\"700\" height=\"184\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img4-Checking-if-the-string-is-not-empty-using-test-command.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img4-Checking-if-the-string-is-not-empty-using-test-command-300x79.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p style=\"text-align: justify;\">The above image states that the inserted variable length is non-zero meaning that it is a non-empty string.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_Equality_Checking_Using_%E2%80%9C%E2%80%9D\"><\/span>3. Equality Checking Using \u201c=\u201d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The \u201c=\u201d is an operator that checks if two strings are equal. The syntax <code class=\"\" data-line=\"\">if [ &quot;$String1&quot; = &quot;$String2&quot; ]<\/code> does the equality checking of the strings. Here\u2019s an example for you:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Defining two strings\nString1=&quot;Hi, Linux!&quot;\nString2=&quot;Hi, Linux!&quot;\n\n#Checking if the strings are equal\nif [ &quot;$String1&quot; = &quot;$String2&quot; ]; then\n\u00a0 echo &quot;Equal strings&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\"> This script declares two variables <strong>String1 <\/strong>and <strong>String2<\/strong>, then checks if the two strings are equal using the \u2018=\u2019 operator and displays the output &#8220;Equal strings&#8221;. <\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-26880\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img5-Checking-if-two-strings-are-equal-using-test-command.png\" alt=\"Checking if two strings are equal using 'test' command\" width=\"700\" height=\"204\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img5-Checking-if-two-strings-are-equal-using-test-command.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img5-Checking-if-two-strings-are-equal-using-test-command-300x87.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>The above image is a demonstration of equality checking of two strings.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_Inequality_Checking_Using_%E2%80%9C%E2%80%9D\"><\/span>4. Inequality Checking Using \u201c!=\u201d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The \u201c!=\u201d is an operator that verifies and returns true if two strings are not equal. Only using the syntax <code class=\"\" data-line=\"\">if [ &quot;$String1&quot; != &quot;$String2&quot; ]<\/code> is enough to perform the inequality check. Let\u2019s have a look at the following example:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Defining two strings\nString1=&quot;Hi, Linux!&quot;\nString2=&quot;Hi, Windows!&quot;\n\n#Checking if the strings are not equal\nif [ &quot;$String1&quot; != &quot;$String2&quot; ]; then\n\u00a0 echo &quot;Not Equal Strings&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\"> This Bash script declares two variables <strong>String1 <\/strong>and <strong>String2<\/strong>, checks if the two strings are not equal using the\u00a0 \u2018!=\u2019 operator and displays the output &#8220;Not Equal Strings&#8221;. <\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-26881\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img6-Checking-if-two-strings-not-equal-using-test-command.png\" alt=\"Checking if two strings not equal using 'test' command\" width=\"700\" height=\"176\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img6-Checking-if-two-strings-not-equal-using-test-command.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img6-Checking-if-two-strings-not-equal-using-test-command-300x75.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>In the above image, you will see a demonstration of inequality checking of two strings.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Bash_%E2%80%98if_Conditional_Test_for_File_Directory_Comparisons\"><\/span>Bash \u2018if\u2019 Conditional Test for File &amp; Directory Comparisons<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">Conditional testing is not only confined to numerical and string comparisons. Several file and directory operations can be performed using the test command in \u2018if\u2019 conditional statements in Bash.<\/p>\n<p style=\"text-align: justify;\">Some common test operations can be implemented on files and directories using some <strong>Unary Operators<\/strong> where the output becomes true only for the existing file and directory that contains the following characteristics:<\/p>\n<div class=\"su-table su-table-responsive su-table-alternate su-table-fixed\">\n<table style=\"width: 100%\" width=\"100%\">\n<tbody>\n<tr>\n<th style=\"width: 28.4848%\" width=\"186\"><strong>Unary Operators<\/strong><\/th>\n<th style=\"width: 70.5455%\" width=\"414\"><strong>Purposes<\/strong><\/th>\n<\/tr>\n<tr>\n<td style=\"width: 28.4848%;text-align: center\" width=\"186\">-d<\/td>\n<td style=\"width: 70.5455%\" width=\"414\">Checks if it is a directory.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 28.4848%;text-align: center\" width=\"186\">-e<\/td>\n<td style=\"width: 70.5455%\" width=\"414\">Checks if a file\/directory exists.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 28.4848%;text-align: center\" width=\"186\">-f<\/td>\n<td style=\"width: 70.5455%\" width=\"414\">Checks if it is a regular file.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 28.4848%;text-align: center\" width=\"186\">-h \/ -L<\/td>\n<td style=\"width: 70.5455%\" width=\"414\">Checks if an existing file is a symbolic link.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 28.4848%;text-align: center\" width=\"186\">-r<\/td>\n<td style=\"width: 70.5455%\" width=\"414\">Checks if a file is readable.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 28.4848%;text-align: center\" width=\"186\">-s<\/td>\n<td style=\"width: 70.5455%\" width=\"414\">Checks if a file size is greater than zero.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 28.4848%;text-align: center\" width=\"186\">-x<\/td>\n<td style=\"width: 70.5455%\" width=\"414\">Checks if a file is executable.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 28.4848%;text-align: center\" width=\"186\">-w<\/td>\n<td style=\"width: 70.5455%\" width=\"414\">Checks if a file is writable.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 28.4848%;text-align: center\" width=\"186\">-N<\/td>\n<td style=\"width: 70.5455%\" width=\"414\">Checks if an existing file has been modified since it was last read.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 28.4848%;text-align: center\" width=\"186\">-S<\/td>\n<td style=\"width: 70.5455%\" width=\"414\">Checks if a file is a socket file.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p style=\"text-align: justify;\">The following example can be a helpful demo for you to understand how to perform a simple test operation on a file:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Checking if the file is executable\nfile=&quot;file1.sh&quot;\nif [ -x &quot;$file&quot; ]; then\n\u00a0 echo &quot;$file is executable.&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 Bash script assigns a script file to a variable and then checks if the file is executable using <strong>[ -x &#8220;$file&#8221; ]<\/strong> and displays the output &#8220;file1.sh is executable&#8221;. <\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-26882\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img7-Checking-if-the-file-is-executable-using-test-command.png\" alt=\"Checking if the file is executable using 'test' command\" width=\"700\" height=\"167\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img7-Checking-if-the-file-is-executable-using-test-command.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/img7-Checking-if-the-file-is-executable-using-test-command-300x72.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>The above image describes that the assigned file <strong>file1.sh<\/strong> is executable.<\/p>\n<p style=\"text-align: justify;\">According to the context of the previous discussion, you can perform conditional tests on pairs of files too by using<strong> Binary Operators <\/strong>like \u201c-ot (Checks if a file is older than another one)\u201d, \u201c-nt (Checks if a file is newer than another one)\u201d and so on.<\/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;\">The whole article provides you a proper knowledge of how you can perform different conditional tests in Bash. So, whether it\u2019s for checking numeric values, file permissions, string comparisons, or verifying logical conditions, the test command always empowers you to make proper decisions and create responsive scripts by automating your tasks.<\/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=\"Is_there_a_shorthand_for_combining_conditions_in_an_%E2%80%98if_statement_using_the_%E2%80%98test_command\"><\/span>Is there a shorthand for combining conditions in an \u2018if\u2019 statement using the \u2018test\u2019 command?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><strong>Yes<\/strong>, you can use the <strong>logical operators <\/strong>\u2018-a (AND)\u2019 or \u2018-o (OR)\u2019 within the square brackets as a shorthand for combining conditions in an \u2018if\u2019 statement in Bash using the \u2018test\u2019 command. For example, <code class=\"\" data-line=\"\">[ condition1 -o condition2 ]<\/code><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Is_there_any_difference_between_the_and_operators_in_the_%E2%80%98test_command_when_comparing_strings_in_an_%E2%80%98if_statement\"><\/span>Is there any difference between the = and == operators in the \u2018test\u2019 command when comparing strings in an \u2018if\u2019 statement?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><strong>No<\/strong>, there is no difference between the \u2018=\u2019 and \u2018==\u2019 operators in the \u2018test\u2019 command. Both operators are equivalent and you can use any one of your choice when comparing strings in an \u2018if\u2019 statement.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_If_a_string_starts_with_a_specific_prefix_using_the_%E2%80%98test_command_in_an_%E2%80%98if_statement\"><\/span>How to If a string starts with a specific prefix using the \u2018test\u2019 command in an \u2018if\u2019 statement?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To check if a string starts with a specific prefix, use a string operator with \u2018#\u2019. Here\u2019s the syntax you can follow where the conditional checks if the string starts with a prefix: <code class=\"\" data-line=\"\">if [ &quot;${string#prefix}&quot; = &quot;$string&quot; ] <\/code><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Is_there_a_way_to_check_If_a_string_ends_with_a_specific_suffix_using_the_%E2%80%98test_command_in_an_%E2%80%98if_statement\"><\/span>Is there a way to check If a string ends with a specific suffix using the \u2018test\u2019 command in an \u2018if\u2019 statement?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><strong>Yes<\/strong>, you can use a string operator with \u2018<strong>%<\/strong>\u2019 in an \u2018if\u2019 statement in a format like <code class=\"\" data-line=\"\">if [ &quot;${string%suffix}&quot; = &quot;$string&quot; ]<\/code> to check if the string ends with a specific suffix.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_use_wildcard_patterns_with_the_%E2%80%98test_command_in_an_%E2%80%98if_statement_to_match_filenames\"><\/span>Can I use wildcard patterns with the \u2018test\u2019 command in an \u2018if\u2019 statement to match filenames?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><strong>Yes<\/strong>, you can use wildcard patterns with the \u2018test\u2019 command in an \u2018if\u2019 statement to match filenames. For instance, <code class=\"\" data-line=\"\">if [ -f *.sh ]<\/code> checks if there exist any files with the \u2018.sh\u2019 extension in the current directory.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_test_If_a_command_is_running\"><\/span>How to test If a command is running?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To test if a command is running, use the <code class=\"\" data-line=\"\">ps aux<\/code> command and then pipe the output to <code class=\"\" data-line=\"\">grep<\/code>. This \u2018ps (process status)\u2019 command checks the list of running processes and the \u2018grep\u2019 command then looks for the particular command\/process. For example:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Specifying the process name\nprocess=&quot;X&quot;\n\n#Checking if the process is running\nif ps aux | grep -q &quot;$process&quot;; then\n\u00a0 echo &quot;Yes! $process is running.&quot;\nfi<\/code><\/pre>\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\/conditional-statements\/if\/if-options\/\" target=\"_blank\" rel=\"noopener\">Mastering 10 Essential Options of If Statement in Bash<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-true-false\/\" target=\"_blank\" rel=\"noopener\">How to Check a Boolean If True or False in Bash [Easy Guide]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-empty-or-not\/\" target=\"_blank\" rel=\"noopener\">Check If a Variable is Empty\/Null or Not in Bash [5 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/set-variable-if-not\/\" target=\"_blank\" rel=\"noopener\">Check If a Variable is Set or Not in Bash [4 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/environment-variable-exists\/\" target=\"_blank\" rel=\"noopener\">Check If Environment Variable Exists in Bash [6 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/modulo-if\/\" target=\"_blank\" rel=\"noopener\">Bash Modulo Operations in &#8220;If&#8221; Statement [4 Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/or-and-not-in-if\/\" target=\"_blank\" rel=\"noopener\">How to Use &#8220;OR&#8221;, &#8220;AND&#8221;, &#8220;NOT&#8221; in Bash If Statement [7 Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/multiple-if-conditions\/\" target=\"_blank\" rel=\"noopener\">Evaluate Multiple Conditions in Bash \u201cIf\u201d Statement [2 Ways]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/double-brackets\/\" target=\"_blank\" rel=\"noopener\">Using Double Square Brackets \u201c[[ ]]\u201d in If Statement in Bash<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/check-if-file-exists\/\" target=\"_blank\" rel=\"noopener\">6 Ways to Check If a File Exists or Not in Bash<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/check-if-file-is-empty\/\" target=\"_blank\" rel=\"noopener\">How to Check If a File is Empty in Bash [6 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/check-if-directory-exists\/\" target=\"_blank\" rel=\"noopener\">7 Ways to Check If Directory Exists or Not in Bash<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/negate-if\/\" target=\"_blank\" rel=\"noopener\">Negate an &#8220;If&#8221; Condition in Bash [4 Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-command-fails\/\" target=\"_blank\" rel=\"noopener\">Check If Bash Command Fail or Succeed [Exit If Fail]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-one-line\/\" target=\"_blank\" rel=\"noopener\">How to Write If Statement in One Line? [2 Easy Ways]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-loop\/\" target=\"_blank\" rel=\"noopener\">Different Loops with If Statements in Bash [5 Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/flags\/\" target=\"_blank\" rel=\"noopener\">How to Use Flags in Bash If Condition? [With Example]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/compare-dates\/\" target=\"_blank\" rel=\"noopener\">Learn to Compare Dates in Bash [4 Examples]<\/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;If Statement 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\/conditional-statements\/if\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/\" target=\"_blank\" rel=\"noopener\">If Statement in Bash<\/a><\/span> | <span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash Conditional Statements&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\/conditional-statements\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/\" target=\"_blank\" rel=\"noopener\">Bash Conditional Statements<\/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<p><script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": {\n    \"@type\": \"Question\",\n    \"name\": \"Is there any difference between the = and == operators in the \u2018test\u2019 command when comparing strings in an \u2018if\u2019 statement?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"No, there is no difference between the \u2018=\u2019 and \u2018==\u2019 operators in the \u2018test\u2019 command. Both operators are equivalent and you can use any one of your choice when comparing strings in an \u2018if\u2019 statement.\"\n    }\n  }\n}\n<\/script><\/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;26859&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;Bash Test Operations in \u2018If\u2019 Statement&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>Bash test operation is a prominent way to use the built-in \u201ctest\u201d command or the equivalent operator [ ] (square &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Bash Test Operations in \u2018If\u2019 Statement\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#more-26859\" aria-label=\"Read more about Bash Test Operations in \u2018If\u2019 Statement\">Read more<\/a><\/p>\n","protected":false},"author":314905,"featured_media":26865,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[166],"class_list":["post-26859","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash-scripting","tag-if-statement","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>Bash Test Operations in \u2018If\u2019 Statement - LinuxSimply<\/title>\n<meta name=\"description\" content=\"Bash &#039;if&#039; conditional test enables a strong verification of different logical conditions and makes Bash scripts more responsive.\" \/>\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\/conditional-statements\/if\/if-test\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bash Test Operations in \u2018If\u2019 Statement - LinuxSimply\" \/>\n<meta property=\"og:description\" content=\"Bash &#039;if&#039; conditional test enables a strong verification of different logical conditions and makes Bash scripts more responsive.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/nadiba.rahman?mibextid=ZbWKwL\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-12T12:07:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-09T11:33:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/Feature-image-Bash-if-statement-test.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=\"Nadiba Rahman\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nadiba Rahman\" \/>\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\\\/conditional-statements\\\/if\\\/if-test\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/if\\\/if-test\\\/\"},\"author\":{\"name\":\"Nadiba Rahman\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/69b717a03a5d9dc48e683aaffe22d33f\"},\"headline\":\"Bash Test Operations in \u2018If\u2019 Statement\",\"datePublished\":\"2023-11-12T12:07:48+00:00\",\"dateModified\":\"2024-05-09T11:33:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/if\\\/if-test\\\/\"},\"wordCount\":1670,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/if\\\/if-test\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/Feature-image-Bash-if-statement-test.png\",\"keywords\":[\"if statement\"],\"articleSection\":[\"Bash Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/if\\\/if-test\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/if\\\/if-test\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/if\\\/if-test\\\/\",\"name\":\"Bash Test Operations in \u2018If\u2019 Statement - LinuxSimply\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/if\\\/if-test\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/if\\\/if-test\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/Feature-image-Bash-if-statement-test.png\",\"datePublished\":\"2023-11-12T12:07:48+00:00\",\"dateModified\":\"2024-05-09T11:33:59+00:00\",\"description\":\"Bash 'if' conditional test enables a strong verification of different logical conditions and makes Bash scripts more responsive.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/if\\\/if-test\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/if\\\/if-test\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/if\\\/if-test\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/Feature-image-Bash-if-statement-test.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/Feature-image-Bash-if-statement-test.png\",\"width\":400,\"height\":400,\"caption\":\"Feature image-Bash 'if' statement test.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/if\\\/if-test\\\/#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 Conditional Statements\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"If Statement in Bash\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/conditional-statements\\\/if\\\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Bash Test Operations in \u2018If\u2019 Statement\"}]},{\"@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\\\/69b717a03a5d9dc48e683aaffe22d33f\",\"name\":\"Nadiba Rahman\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Nadiba-Rahman-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Nadiba-Rahman-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Nadiba-Rahman-II-96x96.png\",\"caption\":\"Nadiba Rahman\"},\"description\":\"Hello, This is Nadiba Rahman, currently working as a Linux Content Developer Executive at SOFTEKO. I have completed my graduation with a bachelor\u2019s degree in Electronics &amp; Telecommunication Engineering from Rajshahi University of Engineering &amp; Technology (RUET).I am quite passionate about crafting. I really adore exploring and learning new things which always helps me to think transparently. And this curiosity led me to pursue knowledge about Linux. My goal is to portray Linux-based practical problems and share them with you. Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/nadiba.rahman?mibextid=ZbWKwL\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/nadiba-rahman-443459171\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/nadiba\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bash Test Operations in \u2018If\u2019 Statement - LinuxSimply","description":"Bash 'if' conditional test enables a strong verification of different logical conditions and makes Bash scripts more responsive.","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\/conditional-statements\/if\/if-test\/","og_locale":"en_US","og_type":"article","og_title":"Bash Test Operations in \u2018If\u2019 Statement - LinuxSimply","og_description":"Bash 'if' conditional test enables a strong verification of different logical conditions and makes Bash scripts more responsive.","og_url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/nadiba.rahman?mibextid=ZbWKwL","article_published_time":"2023-11-12T12:07:48+00:00","article_modified_time":"2024-05-09T11:33:59+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/Feature-image-Bash-if-statement-test.png","type":"image\/png"}],"author":"Nadiba Rahman","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Nadiba Rahman","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/"},"author":{"name":"Nadiba Rahman","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/69b717a03a5d9dc48e683aaffe22d33f"},"headline":"Bash Test Operations in \u2018If\u2019 Statement","datePublished":"2023-11-12T12:07:48+00:00","dateModified":"2024-05-09T11:33:59+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/"},"wordCount":1670,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/Feature-image-Bash-if-statement-test.png","keywords":["if statement"],"articleSection":["Bash Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/","url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/","name":"Bash Test Operations in \u2018If\u2019 Statement - LinuxSimply","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/Feature-image-Bash-if-statement-test.png","datePublished":"2023-11-12T12:07:48+00:00","dateModified":"2024-05-09T11:33:59+00:00","description":"Bash 'if' conditional test enables a strong verification of different logical conditions and makes Bash scripts more responsive.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/Feature-image-Bash-if-statement-test.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/11\/Feature-image-Bash-if-statement-test.png","width":400,"height":400,"caption":"Feature image-Bash 'if' statement test.png"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/if-test\/#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 Conditional Statements","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/"},{"@type":"ListItem","position":4,"name":"If Statement in Bash","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/if\/"},{"@type":"ListItem","position":5,"name":"Bash Test Operations in \u2018If\u2019 Statement"}]},{"@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\/69b717a03a5d9dc48e683aaffe22d33f","name":"Nadiba Rahman","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Nadiba-Rahman-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Nadiba-Rahman-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Nadiba-Rahman-II-96x96.png","caption":"Nadiba Rahman"},"description":"Hello, This is Nadiba Rahman, currently working as a Linux Content Developer Executive at SOFTEKO. I have completed my graduation with a bachelor\u2019s degree in Electronics &amp; Telecommunication Engineering from Rajshahi University of Engineering &amp; Technology (RUET).I am quite passionate about crafting. I really adore exploring and learning new things which always helps me to think transparently. And this curiosity led me to pursue knowledge about Linux. My goal is to portray Linux-based practical problems and share them with you. Read Full Bio","sameAs":["https:\/\/www.facebook.com\/nadiba.rahman?mibextid=ZbWKwL","https:\/\/www.linkedin.com\/in\/nadiba-rahman-443459171"],"url":"https:\/\/linuxsimply.com\/author\/nadiba\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/26859","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\/314905"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=26859"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/26859\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/26865"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=26859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=26859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=26859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}