The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
System tools - toys I have found 3 January 1999
Need more help on this topic? Click here
This article has no comments
Show me similar articles
This topic deals with some system tools I've recently encounterd.  I figured everyone should know about them.  If you don't see your favourite tool here, please add your comments.  In some cases, I've merely reproduced the first bit of the man page for the command in question.

Thanks to Lazarus\ from #FreeBSD on undernet irc for prompting this topic.

See also My list of things for a new box.

last
Last will list the sessions of specified users, ttys, and hosts, in reverse time order. Each line of output contains the user name, the tty from which the session was conducted, any hostname, the start and stop times for the session, and the duration of the session.  If the session is still continuing or was cut short by a crash or shutdown, last will so indicate.
strings
This command will print the strings of printable characters in files.  Very useful.  strings is mainly useful for determining the contents of non-text files.
swapinfo
This command I've actually seen before and I've discussed it previously under swap files.  But I figured it should be included here.  I've not used this command often, so I can't tell you much more about it.
su-2.02# swapinfo
Device      1K-blocks     Used    Avail Capacity  Type
/dev/wd0s1b    256000     9568   246368     4%    Interleaved
systat
This command displays various systems statistics.  There are various options.   See man systat.  Here's what it did for me.
                /0   /1   /2   /3   /4   /5   /6   /7   /8   /9   /10
     Load Average   

                /0   /10  /20  /30  /40  /50  /60  /70  /80  /90  /100
             <idle> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
root         systat XXX
top
This displays and updates the information about the top cpu processes.  It's dynamic and will refresh as you watch.  Here's a short sample from entering top -S -I -q:
last pid: 28805;  load averages:  0.00,  0.00,  0.00          14:17:00
40 processes:  1 running, 39 sleeping
CPU states: 0.4% user, 0.0% nice,  1.5% system, 0.4% interrupt, 97.7% idle
Mem: 888K Active, 64K Inact, 100K Wired, 272K Cache, 1511K Buf, 1728K Free
Swap: 250M Total, 6980K Used, 243M Free, 3% Inuse

  PID USERNAME PRI NICE SIZE    RES STATE    TIME   WCPU    CPU COMMAND
28805 root    -12 -20   624K   864K RUN      0:00  3.11%  1.72% top
    4 root     28   0     0K    12K update  16:27  0.04%  0.04% update
   95 root      2 -12   424K   404K select  13:37  0.04%  0.04% xntpd
These tools work just the regular tools, but work on both compressed and uncompressed files.

Need more help on this topic? Click here
This article has no comments
Show me similar articles