In Ubuntu, terminating a process or terminating a running program is typically done through kill, Killall, Pkill, Xkill, and so on. -------------------------------------------------------------------First look at two examples: example one: End a program, such as Firefox type command: Pkill firefox example Two: End a process, such as find First Use the PS command to view the PID of the process. Type PS, as shown below: PID TTY time command 285 1 00:00:00-bash 287 3 00:00:00-bash 289 5 00:00:00/sbin/mingetty tty5 290 6 00:00:00/sbin/mingetty tty6 312 3 00:00:00 telnet bbs3 341 4 00:00:00/sbin/mingetty tty4 345 1 00:00:00 Find/-name foxy.jpg 348 1 00:00:00 ps You can see that the PID corresponding to this process is 345, and now use the KILL command to terminate the process. Type: # Kill 345 again with the PS command to see that the find process has been killed. ---------------------------------------------------------------------------below to learn about the commands: one, the command to view the process has PS, Pstree , pgrep & nbsp &NBSP;1, PS &NBsp show process information, parameters can be omitted - Aux show process in BSD style common &NBSP;-EFH show process -e in System V style,-A shows all processes a &NBS P Show processes for all users on the terminal x show no terminal process u Show details f &NB Sp Tree display w Full display information l Show long list Meaning of the output fields for each column: USER process owner PID process id ppid Parent process%cpu &NBSP;CPU occupancy%mem memory usage ni Process priority. The larger the value, the less CPU time is consumed. vsz process Virtual size RSS page file occupancy tty & nbsp Terminal Idstat process status +---D non-disruptive UninterRuptible sleep (usually IO) +---R running, or process in Queue +---S in hibernation +---T stop or be traced +---Z Zombie Process +---W enter memory swap (invalid starting from kernel 2.6) +---X dead process +---< HIGH priority +---N & nbsp, Low priority +---L Some pages are locked into memory +---s contains sub-processes +---+ in the background of the process group; +---L multi-threading, Clone Threads & nbsp;multi-threaded (using Clone_thread, like NPTL pthreads do) PID: Process identifier, the system assigns a recognition code to each process, called a PID. &NBSP;PS commands are very popular, other commands are: 2.pstree Tree display process information-a show full commands and parameters -c repeating process shows &N BSP;-C Show process ID pid -n by PID process 3.pgrep < process name > &NBS P show process pid-l show process name and process Pid -o process start id -n process terminate id Two, end process command has kill, Pkill, Killall, Xkill, etc.: kill [signal code] < process pid> According to the PID to send signals to the process, often to end the process, the default signal is -9 signal code, the value is as follows:-l [Signal number] display, translation signal code -9,-kill send KILL signal exit -6,-ABRT send abort signal exit -15,-term send termination signal -1,-hup hang -2,-int Interrupt from keyboard, equivalent to Ctrl+c -3,-quit exit from keyboard, equivalent to ctrl+d -4,-ill illegal instruction -11,-SEGV memory error -13,-pipe destroy pipeline -14 ,-alrm -stop stops the process, but does not end -cont continue to run the stopped process -9-1 end all processes of the current user pkill < process name > &N Bsp end of process family. If you end a single process, use Killkillall < process name > &N Bsp killall and Pkill application methods are similar, but also directly kill the running program, if you want to kill a single process, kill it. Xkill in the graphical interface to kill the process. When the Xkill is running, the mouse pointer changes to a skeleton pattern, which graphics program crashes a bit and is OK. If you want to terminate the Xkill, press the right button to cancel. For example, when Firefox crashes and cannot exit, Firefox can be killed by clicking the mouse button. Xkill Call Method:
Linux view and end process commands in a detailed