# Interesting base system programs you may not know about...



## nickednamed (Dec 3, 2012)

A while ago FreeBSD forum user Beastie brought to my attention a great little program: math/units which is part of the base system.

So I was wondering if anybody knows of any other useful / interesting base-system gems which may have been overlooked? If you know one, post it here!


----------



## jrm@ (Dec 3, 2012)

If you list the contents of /usr/bin/ you'll see similarly spirited utilities like bc(), calendar(), ncal().

One program in /usr/bin/ that I find helpful is tee().  With it, you can do something like `% prog | tee outfile` and you get prog's output sent to standard output and outfile.


----------



## SirDice (Dec 5, 2012)

Netcat! Often overlooked :e

[cmd=] printf "GET / HTTP/1.0\r\n\r\n" | nc host.example.com 80[/cmd]

See nc(1) for more examples.

And I also like dc(1) instead of bc(1). Mainly because it uses RPN (I'm a big fan) and it can do hexadecimal conversions.


```
dice@molly:~$ dc
16i
C0
p
192
```


----------



## wblock@ (Dec 5, 2012)

fmt(1) has a nice little wordwrap function.  And there's jot(1), which I can't recall using but certainly can do lots of weird things.

Unix Power Tools has a lot of classic command examples.


----------



## nickednamed (Dec 10, 2012)

Thanks guys.

Can't believe how much easier shell scripting will be after checking some of these out; it's like someone already thought of most of the things I want to do. It's a pity that the shell scripting books I have read [and largely forgotten!] had only, grep(), cut(), cat(), echo(), sed(), and a few others I'm sure.

I have actually been going through usr/bin and reading randomly selected programs' man pages, but some of them are a bit esoteric, so it's always nice to see how real people actually use these programs for real life problems, especially in combination.


----------



## fonz (Dec 10, 2012)

In my opinion there's only so much one can learn from a conventional UNIX book. Once you've read one and understand the basics, you're probably better served with Tips&Tricks kind of books (_UNIX Power Tools_, _BSD Hacks_, that sort of thing). Also, choosing random commands from /usr/(s)bin and reading up on what they do is a good way of learning, as you've already discovered. And don't forget the FreeBSD fortune(6) cookies.

Fonz


----------

