1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'General' started by nickednamed, Dec 3, 2012.

  1. nickednamed

    nickednamed New Member

    Messages:
    125
    Likes Received:
    0
    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! :)
     
  2. jrm

    jrm Member

    Messages:
    785
    Likes Received:
    0
    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.
     
  3. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,427
    Likes Received:
    16
    Netcat! Often overlooked :e

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

    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.

    Code:
    dice@molly:~$ dc
    16i
    C0
    p
    192
    
     
  4. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,257
    Likes Received:
    25
    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.
     
  5. nickednamed

    nickednamed New Member

    Messages:
    125
    Likes Received:
    0
    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.
     
  6. fonz

    fonz Moderator Staff Member Moderator

    Messages:
    2,444
    Likes Received:
    7
    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