FreeBSD

FreeBSD Cheatsheet #

FreeBSD is a powerful, free, and open-source Unix-like operating system derived from the Berkeley Software Distribution (BSD). It is known for its advanced networking, security features, and performance. FreeBSD is widely used in servers, desktops, and embedded platforms. Below is a comprehensive cheatsheet to help you get started with FreeBSD, covering various commands and their descriptions.

System Information and Management #

CommandDescription
uname -aDisplay all system information
sysctl -aDisplay all kernel state information
dmesgShow system boot messages
topDisplay real-time system information
ps auxList all running processes
pkg infoList installed packages
pkg install <package_name>Install a package
pkg delete <package_name>Remove a package
su <command>Run a command with superuser privileges

User and Group Management #

CommandDescription
adduserAdd a new user
rmuser <username>Delete a user
pw usermod <username> -G <group>Add a user to a group
pw groupadd <group>Create a new group
pw groupdel <group>Delete a group
passwd <username>Change a user’s password

Network Management #

CommandDescription
ifconfigDisplay or configure network interfaces
ping <hostname/IP>Send ICMP ECHO_REQUEST to network hosts
netstat -rDisplay the routing table
route add <destination> <gateway>Add a static route
service netif restartRestart network interfaces
pfctl -eEnable the packet filter
pfctl -dDisable the packet filter
pfctl -srShow active packet filter rules

Disk Management #

CommandDescription
df -hDisplay disk usage in a human-readable format
du -sh <directory>Show disk usage of a directory
mountDisplay all mounted filesystems
mount /dev/<device> <mount_point>Mount a filesystem
umount <mount_point>Unmount a filesystem
gpart showShow partition layout
newfs /dev/<device>Create a new filesystem on a device

System Services and Daemons #

CommandDescription
service <service> startStart a service
service <service> stopStop a service
service <service> restartRestart a service
sysrc <service>_enable="YES"Enable a service to start at boot
sysrc <service>_enable="NO"Disable a service from starting at boot
service <service> statusCheck the status of a service

File Operations #

CommandDescription
cp <source> <destination>Copy files or directories
mv <source> <destination>Move or rename files or directories
rm <file>Delete a file
rm -r <directory>Delete a directory and its contents
chmod <permissions> <file>Change file permissions
chown <owner>:<group> <file>Change file owner and group
ln -s <target> <link>Create a symbolic link

This cheatsheet covers a range of essential commands for system information, user management, network management, disk management, system services, and file operations in FreeBSD. For detailed information on each command, refer to the FreeBSD manual pages using the man <command> command.

FreeBSD

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.