Search notes:

Shell command: [

[ is a regular executable (/usr/bin/[).
[ xxx ] is equivalent to test xxx.
[ can can be used, for example, in an if statement.

[[ … ]] vs [ … ]

In bash, [[ is a built-in.
Because [[ is a built-in, it allows to compare strings with < and >. With [ … ], < and > would be treated as file redirectors, hence a file would be (over-)written or tried to be read from a file.

See also

test
/usr/bin/[
Shell commands

Index