psql command is used to connect to PostgreSQL database. To login to PostgreSQL database, run
psql -U username-here -W
You will be asked to enter password.
List all databases
To list all databases use command \list or \l
Connect to a database
Before you can use a database, you need to connect to it with
List all tables in a database