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