“if” command

The “if” command is used to execute a command or group of commands if a given condition is true. Here is an example of how to use the “if” command in a shell script:

!/bin/bash
age=18
if [ $age -ge 18 ]
then
echo “You are of legal age”
fi

This script checks if the “age” variable is greater than or equal to 18. If the condition is true, the script prints the message “You are of legal age”.