1 查看目录占用空间大小 du -m|grep jtsc
2 vmstat 查看cpu使用情况
topas 检查异常进程的
3 find . -name "*2008*" |xargs rm
find . -name "*.sh"|xargs grep -i "tb_b_prd_swlh_code"
find . -name "*.out" -print -size 102400
删除结算目录下的不需要的文件
find /public/ControlFile/Bss/settdata/day -name "PassNew_*_200901*.data" |xargs rm
4 rm -r bak 如果目录下有内容先删除目录下文件再删除目录
5 find /public -size +1024000 -print 查找一个G以上的文件
6 查找某目录下的某类型文件中含有指定字符串的文件
find /public/src/chencj/get_data_shell/log -name "*.log" |xargs grep -i "ORA-"
find /public/src/chencj/get_data_shell/log -name "sh_get_etl_data_mend.*.20091126.*.log" |xargs grep -i "ORA-"
find /public/src/chencj/get_data_shell/log -name "sh_get_etl_data_mend.*.20091126.*.log" |xargs grep -i "ORA-" |awk '{print $1}'
7 找到进程并杀掉
ps -ef|grep fDAPDuserdevday|grep -v grep |awk '{ print $2 } ' |xargs kill -9
8 循环扫描指定的程序
flag=`ps -ef | grep -v grep | grep ".*insert_day_rep_fee_month.sh.*" | wc -l`;
while [ ${flag} -gt 1 ]
do
echo "*********执行中************" ${flag}
sleep 5
flag=`ps -ef | grep -v grep | grep ".*insert_day_rep_fee_month.sh.*" | wc -l`;
done
9 在sqlplus中,可以使用!或者host来执行操作系统命令,但是在windows上,!是不能使用的
sqlplus -s $dbconn<<EOF
set heading off;
set feedback off;
set verify off;
set pagesize 0;
host /public/src/zhangpei/shell/others/tb_yuce.sh $day_id
select to_char((sysdate-1),'yyyymm') from dual;
exit;
EOF