FreeBSD pw command examples
Q. How do I use FreeBSD pw command to add users?
A. The pw command is a command-line based editor for the system user and group files, allowing the superuser an easy to use and standardized way of adding, modifying and removing users and groups.
Add user called tom
To add a user called tom, enter:
# pw useradd -n tom -s /bin/csh -m
# passwd tom
Where,
- -n tom : Username
- -s /bin/csh : Set shell
- -m : Create and setup home directory /home/tom
Delete a user called tom
Enter the command:
# pw userdel -n tom -r
Note that -r option remove home directory & its contents.
Getting help with pw command
For a summary of options available with each command, you can use
pw [command] help
For example, lists all available options for the useradd operation.
# pw useradd help
# man pw
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- FreeBSD admin book / handbook
- FreeBSD Hardware compatibility List (HCL)
- FreeBSD locking an account
- FreeBSD Install BASH Shell
- Linux or FreeBSD command to display system time and date
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: add_users, FreeBSD, pw, pw_command



October 2nd, 2007 at 8:17 am
I found that it’s ‘pw user add name’ not ‘pw useradd name’ but thanks for the info!
October 2nd, 2007 at 8:18 am
er also you don’t have to use the -n switch for the user name