How to get a list of current Oracle CDBs on server
This is how I list running database instances. Container-databases or non-container databases: 

  cat &gt;&gt; ~/.bash_profile &lt;&lt;EOF
  oinst() {
      /bin/ps -ef | grep ora_lgw[r] | awk '{print $8}' | sed -e 's/ora_lg[w]r_//'
  }
  EOF

  $oinst
  CDB1
  CDB2
  CDB3


If database instances are not running you are left with information from  /etc/oratab, init&lt;SID&gt;.ora, orapw&lt;SID&gt; or database-files on ASM, filesystem or RMAN.