August 6, 2025

Part 2: A CRM on the command-line with abook, awk, grep and cut

A while ago, I posted https://yctct.com/abook-crm where I described how I use abook with tags, awk and grep altogether as a CRM.

The way I go about this has evolved a bit. I still use the tags with abook, but I no longer have a set script I use to query abook’s file.

I use the following commands, which I recall from history and tweak depending on what I need.

To output a list of URLs of contacts that match a specific tag, say, agency’, I run:

$ awk 'BEGIN {RS = ""; FS = "\n"}/'"tag=agency"'/' ~/.abook/addressbook | grep url | cut -d '=' -f2 

To output a list of names of contacts that match a tag, say, developer’, I use:

$ awk 'BEGIN {RS = ""; FS = "\n"}/'"tag=developer"'/' ~/.abook/addressbook | grep name | cut -d '=' -f2 

When the output is too long, I pipe it to less.

To add contacts I’ve added to .mail_aliases to abook, I merge the aliases’ file into abook, and then, clear duplicates with U in abook.


personal computing command-line interface (cli) gnu linux trisquel shell literacy office applications wiki crm

No affiliate links, no analytics, no tracking, no cookies. This work © 2016-2025 by yctct is licensed under CC BY-SA 4.0 .   about me   contact me   all entries & tags   FAQ   GPG public key

GPG fingerprint: 2E0F FB60 7FEF 11D0 FB45 4DDC E979 E52A 7036 7A88