--hadoop 命令
hadoop fs -du -h /tmp/vovf/
hadoop fs -du -h /tmp/vovf/report_2018012908/*
hadoop fs -du -h /kqdata/S1U_ABNORMAL/2018013112
hadoop fs -cat /tmp/vovf/report_2018012908_bak/act/*|more
--'100.75.147.133' 出现次数
hadoop fs -cat /tmp/vovf/report_2018012908_pre/act/*|grep '100.75.147.133' |wc -l
--删除
hadoop fs -rmr /tmp/vovf/match_2018012908_bak
--hdfs 命令(http://blog.csdn.net/wangloveall/article/details/28578393)
hadoop fs -put lpsa.data /mllib
hadoop fs -ls /mllib
hadoop fs -mkdir /mllib
hdfs dfs -du /kqdata/S1U_ABNORMAL/2018020211/*
hdfs dfs -ls /tmp/vovf/
hdfs dfs -cat /tmp/vovf/report_2018012908_bak/hc/* > /opt/uarvf/2018012908_100.75.147.133_hc2.txt
hdfs dfs -cat /tmp/vovf/report_2018012908_bak/act/* |grep '100.75.147.133' > /opt/uarvf/2018012908_100.75.147.133_act2.txt
hdfs dfs -cat /kqdata/S1U_ABNORMAL/2018020113/20180201135157_10.92.244.37.AVL |more
hdfs dfs -cat /kqdata/S1U_ABNORMAL/2018020113/20180201135157_10.92.244.37.AVL |wc -l
--原始话单提取数据
hdfs dfs -cat /kqdata/S1U_ABNORMAL/2018013110/* |grep '100.75.189.121' > /opt/uarvf/2018013110_100.75.189.121.txt
hdfs dfs -cat /kqdata/S1U_ABNORMAL/2018013110/* |egrep '46000370931118|46002307069984|46007539002159' > /opt/uarvf/2018013110_4600.txt
--进程情况
yarn application -list
--磁盘占用率
df -h
--2018022708 文件大小
du -sh *2018022708*
--第18个出现次数
cat abnormal07_2018020910*.csv |cut -d'|' -f18|sort|uniq -c
--查询文件指定字符串
grep 'Excep' /opt/uarvf/VOLTEVFCloud/log_cloud.out
grep '2409:8808:1905:ca33::1' abnormal228_2018020619021517918220.csv > /opt/uarvf/abnormal228_2018020619021517918220.csv
grep 'path-' log_cloud.out |more
--取文件前100条
head -100 /opt/data/volte/abnormal228_2018020710021517970780.csv > /opt/uarvf/abnormal228_2018020710021517970780.csv
--连接远程数据库 udpiv2
mysql -u root -h 10.92.189.135 -P 3307 -p
mysql -u root -h 172.16.1.91 -P 3307 -p
mysql -u root -p
SET NAMES UTF8;
--mysql导出
mysqldump --socket=/opt/mariadb-data/mariadb.sock --port=3307 --default-character-set=utf8 -uroot -proot uarvovf2 report_sbc_min_tab> /opt/mariadb/20180301_report_sbc_min_tab.sql
SQL形式
mysql -h10.92.244.34 -uroot -proot -P3307 uarvovf2 -e "SELECT * from sys_menu_tab INTO OUTFILE '/opt/mariadb/cnf_menu_tab.sql'"
mysqldump --socket=/opt/mariadb-data/mariadb.sock --port=3307 --default-character-set=utf8 -uroot -proot uarvovf2 report_user_flow_abnormal_tab report_sbc_min_tab /opt/mariadb/uarvovf_20171117.sql
mysqldump --socket=/opt/mariadb-data/mariadb.sock --port=3307 --default-character-set=utf8 -uroot -proot uarvovf2 report_sbc_min_tab --where="datediff(curdate(),stime) <= 100" > /opt/mariadb/20180301_report_sbc_min_tab.sql
mysqldump --socket=/opt/mariadb-data/mariadb.sock --port=3307 --default-character-set=utf8 -uroot -proot uarvovf2 report_sbc_min_tab --where="stime>='2018-09-03 00:00' AND stime<='2018-09-03 23:59'" > /opt/mariadb/20180903_report_sbc_min_tab.sql ;
mysqldump --socket=/opt/mariadb-data/mariadb.sock --port=3307 --default-character-set=utf8 -uroot -proot uarvovf2 alm_rec_tab --where="stime>='2018-10-26 00:00' AND stime<='2018-10-26 23:59'" > /opt/mariadb/20181026_alm_rec_tab.sql ;
scp -r root@10.92.244.34:/opt/mariadb/20181026_alm_rec_tab.sql /home/ops/volte
--xls形式
mysql -h10.92.244.34 -uroot -proot -P3307 uarvovf2 -e "SELECT * from report_sbc_min_tab where stime>='2018-09-09 00:00' AND stime<='2018-09-09 23:59' INTO OUTFILE '/opt/mariadb/20180909_report_sbc_min_tab.sql'"
--mysql导入(mysql 里执行)
source /opt/mariadb/20180301_report_sbc_min_tab.sql
--压缩解压
tar -cvf apache-tomcat-7.0.73.tar /opt/apache-tomcat-7.0.73/ 打包一个tar
tar -xvf /opt/apache-tomcat-7.0.73.tar 解开一个tar
tar -cvzf apache-tomcat-7.0.73.tar.gz /opt/apache-tomcat-7.0.73/ 打包压缩一个 tar
tar -zxvf /opt/apache-tomcat-7.0.73.tar.gz 解压一个tar
tar -cvzf SHHarmfulWeb_20180123.tar.gz /opt/apache-tomcat-7.0.54/webapps/SHHarmfulWeb/
tar -zxvf /opt/apache-tomcat-7.0.73.tar.gz
tar -cvzf Upload_20180420.tar.gz /opt/shharmful/Upload/
查看文件大小
du -h --max-depth=1 /opt/shharmful/datareport
格式化时间
ls -lh --time-style=+"%Y-%m-%d %H:%M:%S"
安装tensorflow
pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
--查找文件
find /opt/shharmful/syn/monitor/ -name "*0520000000_Monitor_201803071400*"
ll /opt/shharmful/syn/monitor/ -name "*0340000048_Monitor_201801301700*"
ll -name "*sh_1526962021994_record*"
find -name "*sh_1526964422857_record*"
mysql查看存储过程
show procedure status;
传文件的到sftp,sftp看本地命令前加l
sftp> lpwd
Local working directory: /root
sftp> lcd /root/shharmful
sftp> lls -l
-rw-r----- 1 root root 683089 Apr 3 16:42 sh_1522744622127_file.zip
-rw-r----- 1 root root 2271 Apr 3 16:42 sh_1522744622127_record.zip
sftp> put sh_1522744622127*
Uploading sh_1522744622127_file.zip to /mvtech/sftp/shanghai/upload/sh_1522744622127_file.zip
sh_1522744622127_file.zip 100% 667KB 222.4KB/s 00:03
Uploading sh_1522744622127_record.zip to /mvtech/sftp/shanghai/upload/sh_1522744622127_record.zip
sh_1522744622127_record.zip 100% 2271 2.2KB/s 00:00
sftp> ls
sh_1522744622127_file.zip sh_1522744622127_record.zip
sftp> ls -l
-rw-r----- 1 shanghai sftp 683089 Apr 3 17:13 sh_1522744622127_file.zip
-rw-r----- 1 shanghai sftp 2271 Apr 3 17:13 sh_1522744622127_record.zip
sftp> pwd
Remote working directory: /mvtech/sftp/shanghai/upload