您的位置:首页 > 其它

查看进程端口,进程号,占用内存

2018-02-12 09:34 495 查看
1:在命令行提示符执行top命令
2:输入大写M,结果按内存占用降序排序;输入大写P,则结果按CPU占用降序排序。(注:大写P可以在capslock状态输入p,或者按Shift+p)
3: ll /proc/12401  查看进程pid对应的全路径 
4,ps  -ef|grep 12401

#查看进程占用物理内存

cat /proc/$PID/status | grep RSS 
$PID=ps aux | grep  weblogic.Name=bi_server1 | awk '{print $2;}' |head -1
cat /proc/45570/status | grep RSS 
VmRSS:  15,960,752 kB

#查看系统内存使用情况
free -m   (内存) (free -g)

-- 查看占用了某端口的进程号
 netstat -ntulp | grep port

netstat -ntulp | grep 50000
(Not all processes could be identified, non-owned process info
  will not be shown, you would have to be root to see it all.)
tcp        0      0 10.35.66.179:50000          0.0.0.0:*                   LISTEN      23185/java

-- 查看进程路径
ps -ef|grep 23185

-- 查看程序进程号
ps -ef|grep check_sentosa_service|grep -v grep |awk '{printf $2}'

-- 查看java进程

jps

nohup ./check_sentosa_service.sh >>check_sentosa_service.log &
查看所有用户下的定时任务
for u in `cat /etc/passwd | cut -d":" -f1`;do crontab -l -u $u;done 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: