type=page
status=published
title=list-domains
next=list-file-groups.html
prev=list-custom-resources.html
~~~~~~

= list-domains

[[list-domains-1]][[GSRFM00163]][[list-domains]]

== list-domains

Lists the domains in the specified directory

[[sthref1462]]

=== Synopsis

[source]
----
asadmin [asadmin-options] list-domains [--help]
[--domaindir domaindir]
[--long={false|true}]
[--header={false|true}]
----

[[sthref1463]]

=== Description

The `list-domains` subcommand lists the domains in the specified domains
directory. If the domains directory is not specified, the domains in the
default directory are listed. If there is more that one domains
directory, the `--domaindir` option must be specified. The status of
each domain is included.

This subcommand is supported in local mode only.

[[sthref1464]]

=== Options

asadmin-options::
  Options for the `asadmin` utility. For information about these
  options, see the link:asadmin.html#asadmin-1m[`asadmin`(1M)] help page.
`--help`::
`-?`::
  Displays the help text for the subcommand.
`--domaindir`::
  The directory where the domains are to be listed. If specified, the
  path must be accessible in the files stem. If not specified, the
  domains in the domain root directory are listed. The default location
  of the domain root directory is as-install``/domains``.
`--long`::
`-l`::
  Displays detailed information about the administration servers in the
  listed domains, including host names and port numbers. The default
  value is `false`.
`--header`::
`-h`::
  Specifies whether a header is displayed when the `--long` option is
  used. The default value is `true`. To suppress the header, set the
  `--header` option to `false`.

[[sthref1465]]

=== Examples

[[GSRFM656]][[sthref1466]]

==== Example 1   Listing Domains

This example lists the domains in the default directory.

[source]
----
asadmin> list-domains
Name: domain1 Status: Running
Name: domain2 Status: Not running
Name: domain4 Status: Running, restart required to apply configuration changes
Command list-domains executed successfully
----

[[sthref1467]]

=== Exit Status

0::
  subcommand executed successfully
1::
  error in executing the subcommand

[[sthref1468]]

=== See Also

link:asadmin.html#asadmin-1m[`asadmin`(1M)]

link:create-domain.html#create-domain-1[`create-domain`(1)],
link:delete-domain.html#delete-domain-1[`delete-domain`(1)],
link:start-domain.html#start-domain-1[`start-domain`(1)],
link:stop-domain.html#stop-domain-1[`stop-domain`(1)],


