Skip to main content

Bash Cheat Sheet

Comparison operators

 Operator  Description   Operator Description
-eq Is equal to   -n Is not null
-ne Is not equal to   -z Is null
-gt Is greater than      
-ge Is greater than or equal to      
-lt Is less then      
-le Is less than or equal to      
== is equal to      
!= is not equal to      
< Is less than      
<= Is less than or equal to      
> Is greater then      
>= Is greater than or equal to