Connecting to the Database
psql [option...] [dbname [username]]
-h, --host=HOSTNAME database server host (default “local socket”)
-p, --port=PORT database server port
-U, --user database username
-d, --dbname=DBNAME database name to connect to. By default it is the same as username
-f, --filename=FILENAME execute commands from file
-?, --help show help
./psql -h localhost -p 5432 -U brytlyt
Will connect to the brytlyt database as the brytlyt database user via port 5432.
psql is a terminal-based front-end to PostgreSQL that enables you to type in queries interactively, issue them to PostgreSQL, and see the query results. Alternatively, input can be from a file. In addition, it also provides meta-commands and various shell-like features to facilitate writing scripts and automating a wide variety of tasks.
See PostgreSQL documentation for more detail.
pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL. pgAdmin may be used on Linux, Unix, Mac OS X and Windows to manage PostgreSQL 9.2 and above.
Downloads are available in source and binary formats at the pgAdmin downloads site.