---
title: "Mac OS/Linux命令集合"
author: "kong6001"
date: "2015-02-11T10:32:22Z"
tags: []
categories: ["操作系统"]
slug: "mac-os-linux"
draft: false
lastmod: "2015-02-11T10:33:37Z"
id: 2185043
url: "https://fanchi.iteye.com/blog/2185043"
---

ps 进程查看

```
ps -ef|grep java
```

 

netstat命令

 

```
netstat -an | grep 3306
```

## lsof命令

通过list open file命令可以查看到当前打开文件，在linux中所有事物都是以文件形式存在，包括网络连接及硬件设备。

 

```
lsof -i:80
```

 

 

-i参数表示网络链接，:80指明端口号，该命令会同时列出PID，方便kill