ps aux --sort=-%cpu |grep -m 11 -v `whoami`
3、查询进程 Mmeory 占用率
ps aux|awk '{a[$11]+=$4}END{for(i in a)print a[i],i}'|sort -n
ps aux |grep -v '^USER'|sort -r -k 4
ps aux |grep -v '^USER'|grep edw2|grep LOCAL=NO | sort -r -k 3|more
ps -ef |grep oms |awk '{print $2}' | xargs kill -9
ps -ef |grep rdc|grep LOCAL=NO |awk '{print $2}' | xargs kill -9
4、查找 21 天前的文件,并删除
find /tmp -type f -name "*.trc" -mtime +21| xargs rm -f
find /BOCC_BACKUP -type f -name "backup_log*" -mtime +30|xargs rm -f
5、How to use date
CST = China Standard Time /etc/sysconfige/clock
ZONE="Asia/Shanghai"
date -s "12:12:12 2004-04-07"
date -s 12:12:12
date -s 20040407
获取前一天日期:
date -d yesterday
date -d yesterday +%Y%m%d
date -d '3 days ago'
date -d tomorrow
date -d '3 days'
卸载文件系统
Kill the process on nfs file system
df |grep home |awk’{print “fuser -ck “ $5}’
If right then execute the output
Umount file system
df |grep home |awk’{print “umount “ $5}’
If right then execute the output
++++++++++++华丽的分界线+++++++++++++++++
修改主机名称
通过配置文件/etc/sysconfig/network 修改。
--------------------------------------------------------
# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
How to set auto startup service
在 suse 中没有 rc.local 如何在开机时启动某个服务?
1.在/etc/init.d 目录下创建一个脚本文件,如 haha.sh
(内容为:
#!/bin/sh
ping -c 30 192.168.0.1 &
)
注意:#!/bin/sh 一定要有. 如果要执行的命令不在/bin 下,则需要写全路径,或者设置 PATH.
2.chmod +x haha.sh
3.cd /etc/init.d/rc3.d
评论