Sammlung nützlicher Befehle

FreeBSD Specific Commands

Resources and System Analysis

sockstat -l46


information about hard drives

geom disk list
camcontrol devlist

geom(8) camcontrol(8)

display I/O statistics of phyisical drives (including delete operations)

gstat -pd


display number of interrupts taken per device

## counts since startup
vmstat -i
## counts for each second
vmstat -i 1


Package Management

find the category of a port

file /usr/ports/*/some-port-name

remove a port and its dependencies (including what depends on them)

## via pkg
pkg delete some-pkg-name
pkg autoremove
## or via portmaster
portmaster -e some-pkg-name

man pkg-delete man pkg-autoremove man portmaster

remove a port while keeping what depends on it

pkg delete -f some-pkg-name

man pkg-delete

rebuild port and dependencies

## include all what depends on it
portmaster -f -r some-pkg-name
## include all it depends on
portmaster -f some-pkg-name

man portmaster

rebuild all ports

portmaster -af

man portmaster

replace an installed port with another version

## example: Perl from 5.24 to 5.26
portmaster -o lang/perl5.26 perl5-5.24.4
## if there are modules, recompile them (e.g. for Perl)
portmaster -f 'p5-*'

man portmaster

update packages matching a glob pattern, which have a newer version available in ports

## example for RubyGems
portmaster --update-if-newer 'rubygem-*'

man portmaster

remove packages matching a glob pattern

pkg delete -g 'php70*'

man pkg-delete

clean out stale ports that used to be depended on

## via pkg
pkg autoremove
## or via portmaster
portmaster -s

man pkg-autoremove man portmaster

show packages with vulnerabilities (with vulnerability DB fetch)

pkg audit -F

man pkg-audit

check installed packages

## check installed files for invalid checksums
pkg check -s
## check for missing dependencies
pkg check -d
## check correct linking of packages and their libraries
pkg check -B

man pkg-check

User Management

edit details of a user (e.g. Shell)

chpass someusername

man chpass

edit unix users of a jail

vipw -d /usr/jails/JAILNAME/etc/

man vipw


view last boot messages

less /var/run/dmesg.boot

disable/enable auto-start of a jail managed with ezjail

ezjail-admin config -r norun my-jail
ezjail-admin config -r run my-jail

man ezjail-admin

run a shell (and its children processes) only on CPU2 + CPU5

cpuset -c -l 2,5 /bin/csh

man cpuset

write GPT boot loader to first disk having its first partition a 512K freebsd-boot

gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0

man gpart

create a second loopback interface and rename it

ifconfig lo1 create
ifconfig lo1 name dummy0

man ifconfig

Cookies helfen bei der Bereitstellung von Inhalten. Durch die Nutzung dieser Seiten erklären Sie sich damit einverstanden, dass Cookies auf Ihrem Rechner gespeichert werden. Weitere Information
commands-freebsd.txt · Zuletzt geändert: 2019/10/22 20:38 von alex