7C00.ME/houmu 2013-05-22

Shell

随时想到,随时添加。

1 获得启动脚本所在目录完整路径

SCRIPT_LOCATION=$(cd `dirname $0` && pwd)

2 查看系统版本架构等

cat /etc/issue
cat /proc/cpuinfo
cat /proc/version
uname -a
lsb_release -a

3 awk, a powerful tool

http://coolshell.cn/articles/9070.html#more-9070

netstat -t > netstat.txt
awk '$6=="ESTABLISHED" {print $4, $5}' netstat.txt