FreeBSD

General

ls -laho

... list the flags as well as the standard file attributes



chflags 0 file

... clear all flags



mount -t ufs -o ufstype=ufs2,ro /dev/sdXY /path/to/mnt/point

... mounting an ufs2 partition as read-only from a GNU/Linux system



mount -t devfs devfs <mounted>/dev

... mounting the device filesystem to another location



ext4fuse /dev/adXsY /mnt

... mounting an ext4 partition from FreeBSD (using sysutils/fusefs-ext4fuse with fuse.ko loaded)



diskinfo -v /dev/ada2

... prints the device info for /dev/ada2



diskinfo -c /dev/ada2

... prints the device info for /dev/ada2



make BATCH_DELETE_OLD_FILES=yes delete-old-libs

... deletes without asking for confirmation



Security

mdconfig

mdconfig -a -t vnode -f myimage.img

... creates an mdX device from this image file, similar to Linux' loopX device



mdconfig -d -u /dev/mdX

... detach the memory device device



pkg

pkg set -A 1 <package>

... marks package as automatic



portmaster

portmaster --check-depends

... cross-checks dependency information for all ports



portmaster --check-port-dbdir

... checks for stale entries in /var/db/ports



portmaster -s

... cleans out stale ports that used to be depended on



portmaster -y --clean-distfiles

... cleans stale distfiles (without prompting)



sockstat

sockstat -l

... shows listening sockets



sysctl

sysctl hw.physmem

... shows the amount of physical memory available



sysutils/bsdadminscripts

pkg_libchk

... check all dynamic libraries



zfs

zpool import -o altroot=/mnt cpool1

... imports the pool with /mnt as alternative root



zpool get all cpool1

... gets all properties and features for cpool1

2026-04-11 10:53:05

minicms - © 2020-2026 Simeon Simeonov