You will have to log in to the database using the psql (see below) command line tool (or use pgadmin or similar tool). The error you are getting appears to be a bash (i.e. Linux shell) error.
This information you want is available through SQL. You can obtain it in 1 of two ways:
Or, you can use the standard
You can find out more about this and more in the PostgreSQL system catalogs documentation here.
Using psql (command to start this is
psql [db_name] from the shell), you can also use
\l (as explained by @a_horse_with_no_name) if you prefer psql tool commands!
In bash, the
\ character is used:
to disable aliases at the beginning of a command (explained here), or
as an escape character (within a command - explained in bash ref 2) or
to allow a command to span multiple lines (at the end of a line on its own - also explained in bash ref 2).
from the shell (cut and paste as-is). After it has run (returns the long listing of your current directory), hit the up-arrow to see what's happening! The
ls -lista is expanded on a single line, however, it can be great for helping make long commands legible!