日常的linux 命令使用记录

网络命令

sudo iftop :查看网络流量,显示ip 以及相应的数据上下行情况;

文件命令

sed -i “s/{find_string}/{replace_string}/g” file_name : 替换文件中的内容,并直接保存

eg : ​ sed “s/\/Users\/Ethan\/Desktop\/test-data\//\/data\/bg_service\/temp_dir\/test_datas/g”

head -n 1000 src_file 获取文件的多小行数据

jstack -l ps aux|grep "ps-name" |grep -v grep | awk '{print$2}' > /data/bg_service/sharding-test/hw.log

sudo -u tomcat7 jmap -histo ps aux|grep /usr/share/tomcat7 |grep -v grep | awk '{print$2}' > /data/dumpwgw/wgwmap$fname.txt