First, let's show you how to connect to the Asterisk command-line interface. As you should recall from the installation, Asterisk typically runs in the background as a service or daemon. If the Asterisk service is already running, type the command below to connect to its command-line interface.
The -r parameter tells the system that you want to re-connect to the Asterisk service. If the reconnection is successful, you'll see something like this:
Notice the *CLI> text? That's your Asterisk command-line prompt. All of the Asterisk CLI commands take the form of module action parameters.... For example, type core show uptime to see how long Asterisk has been running.
You can use the built-in help to get more information about the various commands. Simply type core show help at the Asterisk prompt for a full list of commands, or core show help command for help on a particular command.
If you'd like to exit the Asterisk console and return to your shell, just use the quit command from the CLI. Such as: