Q:

What does the -a unary operator check?

I have just found a couple of examples using [ -a some_dir ] or [ -a some_file ] but can't find what the -a operator is for. It seems it should be described in the man page for test/[ but there it is just as a comparison operator [ $expr1 -a $expr2 ]. It seems it simply returns true if a file or dir exists, no matter the type or so.

A:

In bash and some other shells, -a is a synonym for -e (true if file exists).
$ help test
...
      -a FILE        True if file exists.
...
      -e FILE        True if file exists.

This is non-standard and not supported in all shells, so you better don't rely on it.
Notice that the manpage of test(1) documents the external command (/usr/bin/test, /usr/bin/[, etc), not the shell built-in.

