Skip to content

Alternative Linux commands on FreeBSD

homepage-banner

Introduction

FreeBSD is a free and open-source Unix-like operating system that is based on the Berkeley Software Distribution (BSD). It is known for its reliability, security, and performance. One of the advantages of FreeBSD is that it supports a wide range of applications and utilities that can be used for various purposes. However, some commands on FreeBSD are different from those used on most Linux distributions. In this blog post, we will discuss some Linux commands that can be used as alternatives on FreeBSD.

netstat

# on freebsd sockstat could check sockets state
pkg install sockstat
sockstat
## for IPV4
sockstat -4l
## for IPV6
sockstat -6l

free

pkg install freecolor
freecolor

apt & yum

pkg update && pkg upgrade
pkg install xxx
pkg delete yyy

check swap

pstat -s
swapinfo -h

pidstat

procstat -a

lspci

pciconf -lv
## or 
pkg install pciutils

proc

FreeBSD doesn’t mount procfs file system by default, if you need it, you can mount it yourself

mount -t procfs proc /proc

or add to it /etc/fstab

proc     /proc   procfs  rw    0 0

ldd

display the status of any files dynamically linked into the kernel

kldstat
kldstat -v

insmod & rmmod

cd /boot/kernel
kldstat
kldload zfs.ko

kldstat

kldunload zfs.ko
kldstat

dig

sdig-0.45_1    Translate IP/DNS/WINS/MAC address into port description
pkg install sdig
sdig google.com

Reference

  • https://docs.freebsd.org/en/books/handbook
Leave a message







Disclaimer
  • Welcome to visit the knowledge base of SRE and DevOps!
  • License under CC BY-NC 4.0
  • Made with Material for MkDocs and improve writing by generative AI tools
  • Copyright issue feedback me#imzye.com, replace # with @