OS X系统 各种命令整理20161018
一、如何开启apache
在终端输入apachectl -k start
二、OS X如何打开活动监控器
然后直接拖到dock中
三、查看端口号被占用的情况
1、在终端中输入lsof -i tcp:port 将port换成需要查看的端口号如:80
$ lsof -i tcp:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Google 947 Jason 71u IPv4 0x75ff79c1bcd05d97 0t0 TCP 192.168.253.3:61750->112.65.203.49:http (CLOSE_WAIT)
Google 947 Jason 75u IPv4 0x75ff79c1b799cd97 0t0 TCP 192.168.253.3:61754->123.125.112.242:http (ESTABLISHED)
Google 947 Jason 89u IPv4 0x75ff79c1b914bba7 0t0 TCP 192.168.253.3:61755->220.181.112.111:http (ESTABLISHED)
Google 947 Jason 103u IPv4 0x75ff79c1b5535d97 0t0 TCP 192.168.253.3:61751->112.65.203.49:http (CLOSED)
Google 947 Jason 116u IPv4 0x75ff79c1c38fb9b7 0t0 TCP 192.168.253.3:61752->112.65.203.49:http (CLOSED)
2、然后使用kill命令,终结程序
kill -9 1753