Use == operator with bash if statement to check if two strings are equal. You can also use != to check if two string are not equal. You must use single space before and after the == and != operators.