recdel
TLDR
Delete matching records
$ recdel -e "[Name = 'John']" [file.rec]
Delete by record type$ recdel -t [Type] -e "[condition]" [file.rec]
Delete with confirmation$ recdel -c -e "[Status = 'obsolete']" [file.rec]
Delete first N matches$ recdel -n [1] -e "[condition]" [file.rec]
SYNOPSIS
recdel [options] [file]
DESCRIPTION
recdel deletes records from GNU recutils files matching a selection expression. It modifies the file in place unless outputting to stdout.
Part of GNU recutils.
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
$ # Delete by condition
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
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
$ = - Equal
!= - Not equal
~ - Regex match
<, > - Comparison
&&, || - Logical operators
!= - 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.


