FreeBSD Cheat Sheet

From Leo's Notes
Last edited on 15 June 2020, at 00:24.

FreeBSD Ports

Recursively Configure Ports

make config-recursive

Ports Update / Upgrade

portsnap fetch
portsnap update   

or if you are doing this the first time, run:

portsnap fetch
portsnap extract

You may also get the ports from svn:

svn co svn:// /usr/src
svn up /usr/src

Upgrade FreeBSD

# mv /usr/src /usr/src.old
# svn co svn:// /usr/src

To build and install 9.1-RELEASE:

# mergemaster -p
# cd /usr/src
# make buildworld
# make buildkernel
# make installkernel
# reboot
# cd /usr/src
# make installworld
# mergemaster -iU
# reboot

User Management


Create a new user with a home directory /home/username:

pw useradd -n username -s /bin/sh -m

Remove a user and their home directory:

pw userdel -n username -r

Create a new group

pw groupadd groupname

Show group

pw groupshow groupname

Set user to group

pw groupmod groupname -M username,user2,user3

Add user to group

pw groupmod groupname -m user4