---
title: "开发中的常用unix命令"
author: "hareee"
date: "2009-08-25T12:37:14Z"
tags: []
slug: "unix"
draft: false
lastmod: "2009-10-10T11:20:59Z"
id: 457127
url: "https://hareee.iteye.com/blog/457127"
---

1.查看进程打开的文件数

/usr/sbin/lsof -n |awk '{print $2}'|sort|uniq -c |sort -nr|head

 

2.查找weblogic进程并杀之

ps -ef|grep jrockit |awk '/bea/{print $2}' |xargs kill -9

 

3.查找文件中关键字上下5行

grep -C5 Exception nohup.out

 

4.查看tcp连接数

netstat -an|grep 12.34.56.78 |awk  '{print $6}'|sort| uniq -c

 

5.获取linux下的eth0地址

/sbin/ifconfig|awk '/eth0/{getline;print $2}'|awk -F: '{print $2}'

 

6.查看aix主机cpu使用率

nohup sar -um 1 9999999 &gt; tmp/xxx.log

 

7.查找进程防止被截断

ps auxww|grep xx

 

8.cvs命令行

cvs -d :pserver:user@ip:port/repository