pgrep: 等价于 ps -ef | egrep
# ps -ef | egrep '^root ' | awk '{print $2}' | awk '{printf("%s,",$1)}'可以使用pgrep,显示所有root帐号下的进程,并用逗号隔开:
1,2,3,4,5,20,21,38,39...
# pgrep -d, -u rootpgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout.All the criteria have to match.For example,
1,2,3,4,5,20,21,38,39...
pgrep -u root sshdwill only list the processes called sshd AND owned by root. On the other hand,
pgrep -u root,daemonwill list the processes owned by root OR daemon.
pkill will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout.
Bookmark this post:
|
0 评论:
发表评论