---
title: "LINUX命令"
author: "jackyIT"
date: "2013-10-12T17:03:16Z"
tags: []
categories: ["研发管理"]
slug: "linux"
draft: false
lastmod: "2013-10-12T17:03:16Z"
id: 1955884
url: "https://jackyit.iteye.com/blog/1955884"
---

netstat

    列出某个端口{portno}的连接 

 netstat -antp | grep {portno}| awk '{print $5}' | awk -F: '{print $4}' | sort | uniq

 tcpdump

    http://danielmiessler.com/study/tcpdump/ 

 shell 脚本

    参考手册
        http://tldp.org/LDP/abs/html/refcards.html#AEN22491 Linux_shell培训 
    和]的区别
        http://mywiki.wooledge.org/BashFAQ/031 
    <和<<和<<<的区别
        http://wiki.bash-hackers.org/syntax/redirection 
    关联数组
        http://www.artificialworlds.net/blog/2012/10/17/bash-associative-array-examples/ 

 awk

    某列为某值为条件 

 ps ax | grep scf | grep -v grep | awk '{ if ($5 == "java") {print} }'

    往awk传bash中的数组 

 awk -F',' -v bArr="${banIpArr}" 'bArr ~ $5'

 ldconfig

    更新cache 

 ldconfig -n /opt/dummy/lib
 
 #或者
 vi /etc/ld.so.conf
 ldconfig