Linux命令(45)之pkill

Linux命令之pkill

1.pkill介绍

linux命令pkill用于杀死一个进程,与kill不同的是它会杀死指定名字的所有进程,pkill后跟进程名字,直接对进程对名字进行操作

2.pkill用法

pkill [参数] processname

3.实例

3.1.查看pkill命令详细用法

命令:

pkill --help

[root@cent79-2 ~]# pkill --help

Usage:
 pkill [options] <pattern>

Options:
 -<sig>, --signal <sig>    signal to send (either number or name)
 -e, --echo                display what is killed
 -c, --count               count of matching processes
 -f, --full                use full process name to match
 -g, --pgroup <PGID,...>   match listed process group IDs
 -G, --group <GID,...>     match real group IDs
 -n, --newest              select most recently started
 -o, --oldest              select least recently started
 -P, --parent <PPID,...>   match only child processes of the given parent
 -s, --session <SID,...>   match session IDs
 -t, --terminal <tty,...>  match by controlling terminal
 -u, --euid <ID,...>       match by effective IDs
 -U, --uid <ID,...>        match by real IDs
 -x, --exact               match exactly with the command name
 -F, --pidfile <file>      read PIDs from file
 -L, --logpidfile          fail if PID file is not locked
 --ns <PID>                match the processes that belong to the same
                           namespace as <pid>
 --nslist <ns,...>         list which namespaces will be considered for
                           the --ns option.
                           Available namespaces: ipc, mnt, net, pid, user, uts

 -h, --help     display this help and exit
 -V, --version  output version information and exit

For more details see pgrep(1).
[root@cent79-2 ~]# 

3.2.杀死mysql进程

命令:

pkill mysql文章来源地址https://uudwc.com/A/gkDVn

[root@cent79-2 ~]# pkill mysql
[root@cent79-2 ~]# ps -ef |grep mysql
root       9376   8655  0 13:29 pts/1    00:00:00 grep --color=auto mysql
[root@cent79-2 ~]# 

原文地址:https://blog.csdn.net/z19861216/article/details/131474626

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请联系站长进行投诉反馈,一经查实,立即删除!

h
上一篇 2023年07月13日 09:31
RabbitMQ常用工作模式+整合springboot
下一篇 2023年07月13日 09:35