电脑技术学习

freebsd的PW命令用法详解

dn001

  pw是一个用来创建、删除、修改、显示用户和组的命令行工具。它还有系统用户和组文件编辑器的功能。

  1.pw命令格式:

  1.1组管理

  1.1.1组添加

  pw [-V etcdir] groupadd [group|gid] [-C config] [-q] [-n group] [-g gid]

  [-M members]  [-o] [-h fd | -H fd] [-N] [-P] [-Y]

  1.1.2组删除

  pw [-V etcdir] groupdel [group|gid] [-n name] [-g gid] [-Y]

  1.1.3组更改

  pw [-V etcdir] groupmod [group|gid] [-C config] [-q] [-n name] [-g gid]

  [-l name] [-M members] [-m newmembers] [-h fd | -H fd] [-N] [-P] [-Y]

  1.1.4组显示

  pw [-V etcdir] groupshow [group|gid] [-n name] [-g gid] [-F] [-P] [-a]

  1.1.5 显示可建新组ID

  pw [-V etcdir] groupnext [-C config] [-q]

  1.2用户管理

  1.2.1(1) 用户添加

  pw [-V etcdir] useradd [name|uid] [-C config] [-q] [-n name] [-u uid] [-c comment]

  [-d dir] [-e date] [-p date] [-g group] [-G grouplist] [-m] [-k dir]

  [-w method] [-s shell] [-o] [-L class] [-h fd | -H fd] [-N] [-P] [-Y]

  1.2.1(2)用户添加

  pw [-V etcdir] useradd [name|uid] -D [-C config] [-q] [-b dir] [-e days]

  [-p days] [-g group] [-G grouplist] [-k dir] [-u min,max] [-i min,max]

  [-w method] [-s shell] [-y path]

  1.2.2 用户删除

  pw [-V etcdir] userdel [name|uid] [-n name] [-u uid] [-r] [-Y]

  1.2.3 用户更改

  pw [-V etcdir] usermod [name|uid] [-C config] [-q] [-n name] [-u uid] [-c comment]

标签: