---
name: "pc_query"
section: "1"
platform: "linux"
package: "pycarddav"
version: "0.7.0-1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/pc_query"
---

# pc\_query(1)

query the local address book

## NAME

pc\_query - query the local address book

## SYNOPSIS

**pc\_query** \[*OPTIONS*\] \[SEARCHSTRING\]

## DESCRIPTION

[pc\_query(1)](/pc_query/1.md) prints contacts from a local address book, synchronized with remote CardDAV resources with [pycardsyncer(1)](/pycardsyncer/1.md). Contact information is kept in the *vCard* format, one set of information, corresponding to a business card, is therefore often referred to as a *card*. [pc\_query(1)](/pc_query/1.md) can also import and export vcards from/to the database. [pc\_query(1)](/pc_query/1.md) is part of the *pycarddav* package.

## OPTIONS

### BASIC STARTUP OPTIONS

- **-a, --account**=*NAME*

  Only use the account/resource *NAME* (this option can be used more than once).

- **-c, --config**=*CONFIG*

  Use the configuration file *CONFIG*, otherwise [pc\_query(1)](/pc_query/1.md) will look in *$HOME/.pycard/* and *$HOME/.config/pycard/* for files named *pycard.conf*.

- **--debug**

  This option enables debugging output.

- **-h, --help**

  Print a small help text and exit.

- **-v, --version**

  Print pc\_query’s version number and exit.

### PRINTING OPTIONS

These options can only be used with *SEARCHSTRING* and determine the output format of [pc\_query(1)](/pc_query/1.md). Without any options [pc\_query(1)](/pc_query/1.md) will print the name, telephone numbers and email addresses of all matching contact cards.

- **-A**

  Prints the whole card.

- **-m**

  Only prints names and email addresses, in a mutt friendly format (one line per email address).

- **-t**

  Only prints names and telephone numbers, analogue to -m (but in different sequence)

### FILE INPUT AND OUTPUT OPTIONS

- **-b, --backup***='FILE*

  Backup the local db to BACKUP, if a SEARCHSTRING is present, only backup cards matching it.

- **--delete**

  Delete card matching *SEARCHSTRING*, if more than one matches, the user has to choose one card in an interactive user interface.

- **-i, --import**=*FILE*

  Import vCard from FILE or *STDIN* into the first specified (or default) account

### OTHER OPTIONS

- **--where**=*MODE*

  Decides which part of the contact cards are matched against the searchterm. *MODE* is one of *vcard*, *name* (the structured name, as used in the vcard specification), *fname* (the formated name, meaning as is printed by pc\_query) and *allnames* (*allnames* means search *fname* as well as *name*). While only search through the names might not find what you are looking for, it will considerably speed up your query.

## AUTHOR

pc\_query was mostly written by Christian Geier, with a lot of help by others, see *CONTRIBUTORS.txt* in the pycarddav distribution.

## RESOURCES

Main web site: http://lostpackets.de/pycarddav/ Please report bugs via the contact information at the above web site or via github: http://github.com/geier/khal/.

## SEE ALSO

[pycardsyncer(1)](/pycardsyncer/1.md), [pycard-import(1)](/pycard-import/1.md)

## COPYING

Copyright (C) 2011-2013 Christian Geier and Contributors. pc\_query and pycarddav are released under the terms of the Expat/MIT license, see the *COPYING* file distributed with pycarddav.
