0%

mac的shell命令

前言

此文仅记录mac上和linux不同的shell命令

一、基础操作

二、系统操作

1. 查看网络

1.1. 查看路由

1
netstat -nr

2. 配置端口转发等规则 pf

2.1. 查看pf状态

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Status代表pf规则是否生效
=> sudo pfctl -s info
Password:
No ALTQ support in kernel
ALTQ related functions disabled
Status: Enabled for 0 days 00:06:58 Debug: Urgent
...

# 查看具体pf规则
=> sudo pfctl -sr
No ALTQ support in kernel
ALTQ related functions disabled
pass out route-to utun7 inet proto udp from any to 172.22.230.61 port = 53 group != 18358 keep state
pass out route-to utun7 inet proto udp from any to 172.22.228.106 port = 53 group != 18358 keep state