常用命令

 

strace -p 14037 -fF -s 3000

sudo tcpdump -A -s 300 -i eth1 -n host xx.xx.xx.xx and port 3306

  

grep

rm -f `ls | grep -v 20180207.txt | awk '{print $1}'`
ps -ef f | grep 'python chat_notify' | grep -v grep | awk '{print $2}' | xargs kill -9
rsync -e 'ssh -p 3333' test.c ustc@172.16.0.172:/home/ustc
find /home/workspace/17ce_cdn/output -mtime +7 -name "*.*" -exec rm -rf {} \;
find /logs/makexu_workspace/qqcrawl_83733/output/ -name '*.log' -mtime +7 -exec rm -rf {} \;
find /logs/makexu_workspace/qqcrawl_83733/output/ -name '*.log' -mtime +7 | xargs rm -f
ps -ef f| grep thread_chat_fasttext | grep -v grep |awk '{print $2}'|xargs kill -9  

date

date  +"%Y%m%d" -d  "-n days"    

1

 

netstat -anp |grep 端口号

 

root用户执行

netstat -ntupl

n表示不查询dns

t表示tcp协议

u表示udp协议

p表示查询占用的程序

l表示查询正在监听的程序

 

查看那个进程占用了xxx端口
lsof -i:xxx
查看进程号为xxx的进程在哪里
ps -ef|grep xxx

ps -ef |grep  程序名
netstat -nltp |grep 端口号或服务名

  

posted @ 2018-02-08 10:02  桃源仙居  阅读(105)  评论(0)    收藏  举报