linux常用命令

查询进程启动时间ps -p pid -o lstart

查看一级目录大小
du -h --max-depth=1

ps -ef | grep tomcat
tail -f /usr/local/
/etc/init.d/tomcat5.sh stop
/etc/init.d/tomcat5.sh start
tail -f /usr

打包tar -cvf FXUnion0415.tar FXUnion
解包tar -xvf

监控tomcat   tail -f /usr/local/tomcat-5.0.28/logs/catalina.out


cd /usr/local/tomcat-5.0.28/webapps/
rz -y
unzip log.zip
cd /etc/httpd/conf/
vi mod_jk.conf
cat mod_jk.conf
/usr/sbin/apachectl graceful
ps -ef |grep tomcat
/etc/init.d/tomcat5.sh stop
ps -ef |grep tomcat
/etc/init.d/tomcat5.sh start
ps -ef |grep tomcat

sz下载文件
tail -f -n 200 localhost_log.2010-04-21.txt
tail -f -n 200 /usr/local/tomcat-5.0.28/logs/localhost_log.2010-04-21.txt

struts2和tomcat5.0冲突
cd /usr/local/tomcat-5.0.28/common/
tar cvf endorsed.tar endorsed/
cd endorsed
rm -rf *


apach文档
http://lamp.linux.gov.cn/Apache/ApacheMenu/

apachectl访问日志
cd /var/log/accesslog/access_log/
grep 01a localhost_access_log.2010-05-17-18.txt

apachectl错误日志
cat /var/log/httpd/error_log

定时执行shell
crontab -e
/usr/chmonitor/main_byhour.sh

关闭:mysqladmin -uroot -pa.123 shutdown
启动:/usr/local/mysql/bin/mysqld_safe --user=mysql&
适用于易查服务器mysql

sh -n查看语法错误
sh -x查看执行过程

mysql -pyicha.123
show processlist;
show databases;
mysql操作
http://pojaaer.com/node/4726


grep 01a chargelog.log.2010-05-27-23 |awk '$9=="1" {print $9}'|wc -l

cat   NewClientLogger.log.2010-09-01-*  |awk  '{if ($4=="soft") {a[$6]++}} END{for(i in a ) print a[i],i}'|sort -nr |head -200
cat   NewClientLogger.log.2010-09-01-*  |awk  '{if ($4=="soft") {a[$6]++}} END{for(i in a ) print i,a[i]}'|sort -k 2 -rn|head -200
grep /UB/s/ '/var/log/accesslog/access_log/localhost_access_log.2010-09-07-15.txt' |awk  '{if ($9=="200")  print}'|wc -l


http://linux.chinaitlab.com/special/linuxcom/Index.html

//apach转发
cd /etc/httpd/conf.d/
rewrite.conf
//第一行
RewriteEngine on

RewriteRule     ^/s/final/(.*).sis$     http://localhost/s/Software_2nd.sis [NE,P]
RewriteRule     ^/s/final/(.*).sisx$    http://localhost/s/Software_3rd.sisx [NE,P]

//重载
/etc/init.d/httpd  reload

在/etc/httpd/conf/httd.conf看看有没有
LoadModule rewrite_module modules/mod_rewrite.so

//设置类型
/etc/mime.types

/etc/init.d/httpd  reload


Apache中通过配置http.conf绑定多个域名
http://parkmy.iteye.com/blog/515057
  <VirtualHost   *:80>
          ServerName   zycharge.cn
          DocumentRoot   /usr/local/tomcat-5.0.28/webapps/UB
</VirtualHost>


grep bmd SoftLogger.log.2010-10-12-15 | awk -F'\t' '$4=="" {print $5}'|tail -10
grep zt_ 2010-09-29-* | awk '$5=="1" {print $5}'|wc -l
grep zt_ 2010-09-29-* |wc -l
grep site YXLogger.log | awk -F'\t' '$2=="yx" {print}'
grep result PayLogger.log.2010-11-27-* | awk -F'\t' '$6!="" {print$6,$3}'|sort|uniq|wc -l
awk '$9=="200" {print}' localhost_access_log.2010-12-28-*.txt|grep /NUB11/s/|grep -v .sisx |wc -l
按照第13个域排序后排重
grep 10668600 chargelog.log.2011-01-19-09 |sort -t\t +13n|uniq -f13|wc -l

mysql批量导入
LOAD DATA LOCAL INFILE "F:\\%%.txt" into table t_down_data(oid,title,t_type,url)
LOAD DATA LOCAL INFILE "E:/test.txt"    INTO table  test FIELDS Terminated By '\t'  Lines Terminated By '\r\n'  (ext1,ext3)




linux 下怎么查端口
netstat -anl |grep LISTEN

就看6800是什么命令执行的监听端口
lsof -i:6800

查看lsof -i:6800查询出来的端口
ps -ef |grep 410

重启nginx
/usr/local/nginx/sbin/nginx -s  reload
/usr/local/nginx/sbin/nginx -t

防火墙
cat /etc/sysconfig/iptables


传送文件scp
scp resinAdmin.sh [email protected]:/usr/local/resin/bin


/usr/bin/rsync -auvzrL   192.168.108.52:/opt/ftp/myd/   /opt/db/sat_date/thirdpart/

你可能感兴趣的:(tomcat,mysql,linux,F#,Access)