For testing purposes or if your system doesn't have an HMI, you can stop applications from the command line using the stop-apps script.
Under normal circumstances, however, your HMI stops applications by issuing a stop message to PPS (see "Stopping an application").
stop-apps
The stop-apps script echoes this stop command to the PPS object:
"msg::stop\ndat::" > /pps/services/launcher/control
The Application Launcher service shuts down all the running apps.
For information about Application Launcher and the PPS control object it uses, see launcher in the System Services Reference and /pps/services/launcher/control in the PPS Objects Reference.