-b : 批量操作模式,使用这个参数可以在脚本中使用top命令
-n :配合-b使用,表示重新刷新一定次数后退出
-d :刷新延时时间。例如-d 5 表示top每隔5秒刷新一次。(默认是3秒)-p : Monitor PIDs as: -pN1 -pN2 ... or -pN1, N2 [,...]
-u : Monitor by user as: -u somebody
Monitor only processes with an effective UID or user name matching that given. (仅有效用户)
-U : Monitor by user as: -U somebody
Monitor only processes with a UID or user name matching that given.This matches real, effective, saved, and filesystem UIDs.(显示实际用户或有效用户)
最简单的区别以普通用户执行passwd命令修改密码,
top –u username,
看不到passwd进程,因为-u仅能查看有效用户,passwd进程默认设置了SUID,有效用户身份为root
top –U username,
可以看到passwd进程,进程显示的用户身份为root 而不是username