Home arrow Guides arrow FreeBSD Admin Commands and Tools
FreeBSD Admin Commands and Tools PDF
Saturday, 14 May 2011
This short guide shows most useful FreeBSD admin commands. It's only a list of commands and parameters and is not a complete description of those commands/apps.
For more info about every command see respective man pages.

If you try to run a program and is not on your FreeBSD base system look in ports with whereis program_name (and then cd to that directory and make install && rehash. Some of those commands are not in FreeBSD base system.

pbzip2 -z filename.iso      # better archiving time than bzip2, it scales on many cores (from ports)
pbzip2 -d filename.tbz      # decompress using pbzip2, p stands for parallel (from ports)

top -P                              # show top for every CPU core
lsof                                  # list open files (available from ports)
mtr                                   # mytraceroute, traceroute+ping combined
mtr --curses                    # run in terminal instead of X.org

pgrep p_name                 # returns pid of process p_name
vim -d file1 file2                # start vim in diff mode open both files, show differences between them
gshred filename                # overwrite a file to destroy its contents
sockstat                             # list open sockets
when                                   # a terminal minimalistic calendar program, it also shows you upcoming
                                           # events (when -c to see the calendar)

tail -F file1 file2                   # same as tail -f file, just it display two files in the same terminal

vmstat 2 7                                # report kernel statistics

iostat 2 7                              # report I/O statistics (7 reports, once at 2 seconds)

gstat                                     # show if a hard drive or partition is busy with reads/writes

iozone -a                             # benchmark tool for hard drive

hping                                    # test a host/firewall
iperf                                      # network benchmark  ( iperf -s, iperf -i 2 -t 100 -c -l 32K )
ttcp                                       # measure TCP and UDP performance (ttcp -r -s, ttcp -t -s

glflow                                   # traffic analysis tool (for high speed links)

nload                                    # network load
# network load
slurm -i fxp0                       # network load
ntop                                                   # network load graphics

smartmontools - port           # a useful tool to get hard drive health info,  is available from from ports/packages
smartclt -a /dev/ad0            # utility for smartmontools

ps -ef                                    # see verbose info on running processes

tcptrack -r 10 -i fxp0             # monitor TCP connections, install it from ports

Other usefull tools
pfstat - for graphic monitoring of PF firewall

Quick Guide to Most Important Sysadmin Tools

netperf - Test your router/bridge forward capacity with netperf
Install netperf:

  cd /usr/ports/benchmarks/netperf
  make install clean
Start netperf server (on port 10000):

  netserver -p 10000

Start netperf client to do the benchmark:

  netperf -c -l 60 -H -p 10000 -t TCP_STREAM -i 10,2 -I 99,5 -- -m 64 -s 57344 -S 57344

 -H is the IP of the server
  -t  TCP_STREAM is the test type. You can have different tests, for a comprehensive list see netperf man page. Most important arew TCP_STREAM, UDP_STREAM, TCP_RR, UDP_RR
  -i 10,2 - maximum and minimum number of iterations (for certain confidence level)
  -I 99,5 - confidence level (95 or 99 and the width of the confidence interval (in our case 5)
  -m 64 - message size (usualy used values are 64, 4096 or 32768

Last Updated ( Monday, 25 July 2011 )
< Prev   Next >

Other BSD Systems





Best BSD firewall?