recdel
Delete records from GNU recutils databases
TLDR
Delete matching records
SYNOPSIS
recdel [options] [file]
DESCRIPTION
recdel removes records from GNU recutils plain-text database files that match a given selection expression. It supports the same expression syntax as recsel, including equality, regex matching, comparison operators, and logical combinators, allowing precise targeting of records to delete.
By default it modifies the file in place, but output can be redirected to stdout for safe previewing. The -c flag prompts for confirmation before each deletion, and -n limits the operation to the first N matching records. Part of the GNU recutils toolkit.
PARAMETERS
-t, --type type
Record type.-e, --expression expr
Selection expression.-n, --num n
Delete first n records.-c, --confirm
Ask for confirmation.-i, --case-insensitive
Case insensitive matching.
EXAMPLES
recdel -e "Status = 'deleted'" items.rec
# Delete specific type
recdel -t Contact -e "Email ~ 'spam'" contacts.rec
# Delete with confirmation
recdel -c -e "Price < 0" products.rec
# Delete first match only
recdel -n 1 -e "Name = 'Test'" data.rec
# Dry run (output to stdout)
recdel -e "old = 'yes'" file.rec | less
EXPRESSIONS
!= - Not equal
~ - Regex match
<, > - Comparison
&&, || - Logical operators
CAVEATS
Modifies file in place. Make backups before bulk deletes. Part of GNU recutils.
HISTORY
recdel is part of GNU recutils by Jose E. Marchesi for text-based database management.
