title: Postgres - list databases from Mac terminal
body: <p>I'm experienced with MySQL, but I've just started to work with Postgres - from the terminal on my Mac, how can I see the list of existing Postgres databases using the <code>psql</code> command?</p>
  
  <p>I checked the documentation and I've seen this issue brought up here - <a href="https://dba.stackexchange.com/questions/1285/how-do-i-list-all-databases-and-tables-using-psql">https://dba.stackexchange.com/questions/1285/how-do-i-list-all-databases-and-tables-using-psql</a>, where the accepted solution is to simply type <code>psql \l</code>, and that makes sense to me... however, when I try this, I get the error</p>
  
  <p><code>psql: FATAL:  database "l" does not exist</code></p>
  
  <p>but I am logged in to Postgres - if I type <code>psql DATABASE_NAME</code>, no problem, I get into the database... this was an issue for me recently because I couldn't remember the name of the database that I wanted to work on.  I went into another table (the name of which I did remember), then used the <code>\l</code> command to see my databases and connected to the DB I needed, but I'd much rather just be able to see a list without having to first connect to a database.  How can I do that?</p>