【LINUX CLI】我的常用linux命令备忘录

年纪大了 记不住命令了 常用LINUX备忘录

1. netstat  

 

netstat -tulnp

 

         -t tcp

 

         -u udp

 

         -l listen 仅侦听,而非活动已建立的连接

 

         -n 按编号而非名称显示主机和端口

 

         -p 显示端口号的本地进程

 

-p, --program
Show the PID and name of the program to which each socket belongs.

-l, --listening
Show only listening sockets. (These are omitted by default.)

--numeric , -n
Show numerical addresses instead of trying to determine symbolic host, port or user names.


[root@namenode ~]# netstat -lnp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 172.16.137.45:10033 0.0.0.0:* LISTEN 28758/java tcp 0 0 0.0.0.0:11060 0.0.0.0:* LISTEN 19864/java tcp 0 0 172.16.137.45:8020 0.0.0.0:* LISTEN 9584/java tcp 0 0 172.16.137.45:8022 0.0.0.0:* LISTEN 9584/java tcp 0 0 172.16.137.45:50070 0.0.0.0:* LISTEN 9584/java tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2961/sshd tcp 0 0 0.0.0.0:8088 0.0.0.0:* LISTEN 28945/java tcp 0 0 127.0.0.1:19001 0.0.0.0:* LISTEN 14380/python tcp 0 0 172.16.137.45:31324 0.0.0.0:* LISTEN 19864/java tcp 0 0 0.0.0.0:8030 0.0.0.0:* LISTEN 28945/java tcp 0 0 0.0.0.0:8031 0.0.0.0:* LISTEN 28945/java tcp 0 0 0.0.0.0:8032 0.0.0.0:* LISTEN 28945/java tcp 0 0 0.0.0.0:8033 0.0.0.0:* LISTEN 28945/java tcp 0 0 172.16.137.45:58722 0.0.0.0:* LISTEN 19864/java tcp 0 0 172.16.137.45:10020 0.0.0.0:* LISTEN 28758/java tcp 0 0 172.16.137.45:9000 0.0.0.0:* LISTEN 14345/python tcp 0 0 172.16.137.45:50090 0.0.0.0:* LISTEN 9608/java tcp 0 0 172.16.137.45:19888 0.0.0.0:* LISTEN 28758/java tcp 0 0 :::22 :::* LISTEN 2961/sshd udp 0 0 172.16.137.45:123 0.0.0.0:* 16043/ntpd udp 0 0 10.180.137.45:123 0.0.0.0:* 16043/ntpd udp 0 0 127.0.0.1:123 0.0.0.0:* 16043/ntpd udp 0 0 0.0.0.0:123 0.0.0.0:* 16043/ntpd udp 0 0 fe80::250:56ff:fea2:62d3:123 :::* 16043/ntpd udp 0 0 fe80::250:56ff:fea2:5381:123 :::* 16043/ntpd udp 0 0 ::1:123 :::* 16043/ntpd udp 0 0 :::123 :::* 16043/ntpd Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 [ ACC ] STREAM LISTENING 73768 14380/python /var/run/cloudera-scm-agent/supervisor/supervisord.sock.14377 unix 2 [ ACC ] STREAM LISTENING 8343 1/init @/com/ubuntu/upstart

 2. tcpdump 抓包

tcpdump -i eth1 -s 0 -w httptest.pcap host 10.180.139.198

tcpdump -i eth1 -s 0 -w testplat.pcap host 10.180.184.41

tcpdump -i eth1 -s 0 -w arpdebug.pcap

tcpdump -i eth2 -s 0 -w reg0704.pcap host 10.180.134.26

 3. find

[root@jenkins ~]# find / -name HTMLTestRunner.py 
/opt/rh/python27/root/usr/lib/python2.7/site-packages/HTMLTestRunner.py
/usr/lib/python2.6/site-packages/HTMLTestRunner.py

 

posted @ 2016-12-14 15:10  AlexBai326  阅读(285)  评论(0编辑  收藏  举报