文章目录
  1. 1. ls
  2. 2. netstat
  3. 3. nmap

ls

linux: ls –fulltime
osx: stat -l -t “%F %T %z” *

find . -maxdepth 1 -printf “%M %n %-6u %-6g %6s %TY-%Tm-%Td %TT %TZ %f\n”|sort -k 9
gfind . -maxdepth 1 -printf “%M %n %-6u %-6g %6s %TY-%Tm-%Td %TT %TZ %f\n”|sort -k 9
but without the sort, columns don’t line up and the nanoseconds aren’t included. Plus the syntax for file selection is different and other options for ls aren’t available or are different.
In Mac OSX, gfind is needed (brew install gfind) (and note that the granularity will only be in whole seconds):

netstat

netstat -tunlp vs lsof -ni | grep LISTEN / netstat -anL
OS X has a netstat command, but it doesn’t display information about the programs associated with the network connections. If you want to see that, you need to use lsof instead. Note that it must be run as root (i.e. with sudo) in order to see other users’ programs:

1
2
3
4
5
sudo lsof -i
lsof also has many options for controlling what's displayed:
sudo lsof -i tcp -nP # show TCP unly (no UDP), and don't translate IP addrs and ports numbers to names

sudo lsof -i 6tcp -stcp:listen # show only IPv6 TCP ports in the listen state
sudo lsof -i @10.11.12.13 # show only connections to/from 10.11.12.13

shadowsocks:
https://blog.phpgao.com/shadowsocks_on_linux.html

nmap

macos下用 ipscan-mac
http://angryip.org/download/#mac
If you’re using nmap, MAC addresses are only available if you’re on the same network segment as the target. Newer versions of nmap will only show the MAC address to you if you’re running as root.

1
2
3
sudo nmap -sP -n 192.168.0.0/24
Use snmp-interfaces.nse lua script to get the MAC address of remote mashine like this:
nmap -sU -p 161 -T4 -d -v -n -Pn --script snmp-interfaces 80.234.33.182

文章目录
  1. 1. ls
  2. 2. netstat
  3. 3. nmap