contacts(1)             System General Commands Manual             contacts(1)

     contacts - displays contacts from the AddressBook database

     contacts [-hHsnml] [-f format] [search]

     The utility contacts affords easy access to information in the Address-
     Book database from the shell.

     The utility contacts accepts the following flags:

     -h       displays help/usage

     -H       suppresses headers from being displayed

     -s       sorts the list before displaying it

     -m       show the person marked as "me"

     -n       displays note below each record (by default only one line is
              shown, to see entire note include the -l option)

     -l       loose formatting - doesn't truncate the record values to align

     -f       accepts a format string (see below)

     The format string can contain the following tokens:

     %n       name (first and last name or company name)

     %fn      first name

     %ln      last name

     %p       phone (order of preference: home, work, mobile, main, pager,
              fax, other)

     %hp      home phone

     %wp      work phone

     %mp      mobile phone

     %Mp      main phone

     %pp      pager phone

     %fp      fax phone

     %op      other phone

     %e       email (order of preference: home, work, other)

     %he      home email

     %we      work email

     %oe      other email

     %t       title

     %c       company

     %g       group

     %w       webpage/homepage

     %b       birthday

     %i       instant messanger name (order of preference: aim, yahoo, jabber,
              icq, msn)

     %ai      AOL Instant Messenger (AIM)

     %yi      Yahoo IM

     %ji      Jabber IM

     %ii      ICQ IM

     %mi      MSN IM

     %N       displays the note on a line by itself under the person's record.
              This token should usually be placed at the end of the formatter.

     The contacts utility exits 0 on success, 1 if no one is found in the
     search, 2 for usage problem, and >0 if any other error occurs.

     The command:
           $ contacts
     displays all contacts.

     The command:
           $ contacts -h
     displays the usage.

     The command:
           $ contacts fred
     displays all persons with the name "fred" somewhere in their name.

     The command:
           $ contacts -m
     displays person marked as me.

     The command:
           $ contacts -mH
     displays person marked as me with no header.

     The command:
           $ contacts -mH -f '%e'
     displays the-person-marked-as-me's email address with no header.

     The command:
           $ contacts -f '%n %hp %wp %mp'
     displays everyone's name and home phone, work phone, and mobile phone.

     The command:
           $ contacts -f '%ln %fn %hp'
     displays everyone's last name, first name, and home phone.

     contacts only searches the first name, last name, email, company name,
     and AIM name in the AddressBook, whereas the AddressBook application's
     behavior appears to search everything in the record.

     The format string only recognizes its own tokens i.e. "blah %n" won't
     print "blah fred smith" instead it will just print "fred smith".  Simi-
     larly, "%fn%ln" won't print "fredsmith"; it'll print "fred smith"

Darwin                           June 12, 2003                          Darwin