Postgresql – How to get Postgres database name at Linux terminal

postgresql

I need to connect to a single postgres database but I dont know the name of the database. How can I list names of available databases from the Linux terminal ?

Best Answer

You can use:

psql -l

This requires a login but you can use the same credentials as you would for connecting to the target database