1,软链接的建立
ln -s /home/ddfivfou/www/abc /home/ddfivfou/public_html/abc
2,查找文件中1089出现的次数
cat cs.emarbox.com.log | grep 1809 -c
grep 1809 -c cs.emarbox.com.log
3,查找文件内容
grep '2013-05-31 08:0' com/文件名
4,改变文件/文件夹用户权限
chown -R songhq.songhq
5,查看应用程序占用的端口
netstat -anpt | grep LIST
6,查看磁盘空间
df -h
7,修改了/etc/profile文件,让它立刻生效,不用重新登录
source /etc/profile
8,同步系统时间
/usr/sbin/ntpdate asia.pool.ntp.org
9,查看文件夹下的文件个数(当前目录的文件数)
ls -l |grep "^-" | wc -l
10,文件按照时间排序
ll -t
11,查看java进程技巧
jps -l :查看java的进程号
lsof -p jps得到的进程号:查看java进程打开了哪些文件?
lsof -p jps得到的进程号 | wc -l:查看java进程打开了多少文件
systctrl -a :查看系统参数,尤其关注fs.file-max,可以打开的最大文件数
12,安装rz,sz
yum install lrzsz
13,配置java环境
JAVA_HOME=/usr/java/jdk1.6.0_30
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH
14,启动nginx
/usr/local/nginx/sbin/nginx
15,解压gz文件
gzip -d
16,批量解压gz文件
ls *.gz | xargs -n1 gzip -d
awk -F ',' '$8~3032' */*.dat |awk -F ',' '$5~"click"'|awk -F ',' '$24~1' -> a.log
awk -F ',' '$8~3032' */*.dat |awk -F ',' '$5~"click" && $24~1 {print $5,$8,$24,$32}' ->aa.log
awk -F ',' '$8~1810' */*/*.dat |awk -F ',' '$5~"click" && $24~1 {print $5","$8","$24","$32}' -> aa.log
awk -F ',' '{if($32 != "" ) print $0}' *.log |awk -F ',' '$5~"click" && $24~1 {print $5","$8","$24","$32}' -> aa.log &
awk -F ',' '{if($32 != "" ) print $0}' *.log |awk -F ',' '$5~"click" && $24~1 {print $5","$8","$24","$32","$21}' -> aa.log &
zcat ./*/20140317/i_charging_monitor_20140317_* | awk -F"," '{if($5 == "click" && $24 == 1 && $29 == 0) print $0}' >> /data/songhq/20140317.log &
cat i_charging_monitor_20140320_* | awk -F"," '{if($5 == "impression" && $24 == 1 && $29 == 0 && $8 =="2833") print $0}' >> /data/songhq/20140320_1.log &
--------------------------------------------------------------------------------------------------------------------
zcat ./*/20140320/i_charging_monitor_20140320_* | awk -F"," '{if($5 == "impression" && $24 == 1 && $29 == 0) print $0}' >> /data/songhq/impression/1810/20140320.log &
awk -F ',' '$8~3913' *.log |awk -F ',' '$5~"impression" && $24~1 {print $5","$8","$24","$32}' -> 3913.log
zcat ./*/20140320/i_charging_monitor_20140320_* | awk -F"," '{if($5 == "impression" && $24 == 1 && $29 == 0 && $8 =="2833") print $5","$8","$24","$32}' >> /data/songhq/impression/2833/20140320.log &
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
zcat ./*/20140320/i_charging_monitor_20140320_* | awk -F"," '{if($5 == "impression" && $24 == 1 && $29 == 0) print $5","$8","$24","$32}' >> /data/songhq/20140320/20140320.log &
cat 4380.log | awk -F'\t' '{print $5}'
数据去重
sort -n productid.log | uniq