The killall command can be used to end a process. For example, let's say the gedit program is running. The killall command followed by gedit will end the gedit process.
[john.doe@server1 ~]# killall gedit
The killall command can use different signals. A signals represents how a process should be ended. For example, the terminate signal is less aggresive than the quit signal. Following are some of the common signals.
When a certain signal is not specified, the terminate signal is used.
The killall command followed by the signal name or signal number can be used to end a process with a particular signal. In this example, the hangup signal is used.
[john.doe@server1 ~]# killall -1 gedit
In this example, the quit signal is used.
[john.doe@server1 ~]# killall -sigquit gedit
Let's take an example where gedit is opened in the foreground, and then Ctrl + Z is issued in the Terminal to stop gedit. Gedit remains open, and the killall command with the default terminate signal fails to end gedit.
In this scenario, using a different killall signal should end gedit. The killall signal (9) is able to end gedit.