If statement has no ability to evaluate condition. Only with the help of test command, you can check condition.
[ condition ]
Note: In general, we use square brackets to evaluate condition. Always remember one thing, you must provide a space after the opening square bracket and a space before the closing square bracket. If you forget to do this, you will get an error message.
When you use test command then syntax of if statement will be-
if test condition then commands fi
if [ condition ] then commands fi
There are three different set of conditions that you can evaluate using test command-