参考

1 http://www.ha97.com/3084.html

2 http://hi.baidu.com/dailiangxing/archive/tag/freebsd

3 http://www.cnblogs.com/MeChecksV/articles/1301181.html

4 http://lemon12911.blog.51cto.com/237961/448418

5 http://www.bsdart.org/archives/20101209/380.html

 -----------

1.查看系统IP
ifconfig
cat /etc/rc.conf

2.看内存大小
# dmesg | grep memory
real memory  = 537395200 (512 MB)
avail memory = 509407232 (485 MB)

3.看CPU大小
# dmesg | grep CPU
CPU: Intel(R) Celeron(TM) CPU          
  1300MHz (1295.62-MHz 686-class CPU)
cpu0: <ACPI CPU> on acpi0acpi_throttle0:
 <ACPI CPU Throttling> on cpu0
4.通过硬件模块
# sysctl hw.model
hw.model: Intel(R) Celeron(TM) CPU       1300MHz06.
看具体的主频
# sysctl machdep.tsc_freq
machdep.tsc_freq: 129562289308.

--------------
5.查看DNS配置
cat /etc/resolv.conf

6.查看后台进程运行情况
dmesg

7.freebsd查看系统版本信息的命令
 
uname -a


8.停止ipfw防火墙:
 

ipfw disable firewall
 
/etc/rc.d/ipfw stop
 
9.开启ipfw防火墙:
ipfw enable firewall
 
/etc/rc.d/ipfw start

10.查看FreeBSD的网卡实时流量
systat -if 1

 

11.查看组信息
cat /etc/group
 

freebsd 用户帐号和组管理

pw groupadd mysql_group -g 1001 (-g表示gid为1001)
pw useradd mysql_user -u 1001 -g mysql_group -c "MySQL Daemon" -d /database -s /usr/sbin/nologin
# -s /usr/sbin/nologin 表示该用户被禁止登陆

以上先添加一个组是mysql_group,将gid设为1001,然后加入一个帐号mysql_user ,将uid也设为1001,同时设置此帐号不能用ssh进入系统

如何查看刚建立好的帐号呢,使用:

pw groupshow mysql_group
mysql_group:*:1001:

pw usershow mysql_user
mysql_user:*:1001:1001::0:0:MySQL Daemon:/database:/usr/sbin/nologin

如何删除刚才建立的组呢

pw groupdel -g 1001

这将删除组帐号