LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

recdel

Delete records from GNU recutils databases

TLDR

Delete matching records
$ recdel -e "[Name = 'John']" [file.rec]
copy
Delete by record type
$ recdel -t [Type] -e "[condition]" [file.rec]
copy
Delete with confirmation
$ recdel -c -e "[Status = 'obsolete']" [file.rec]
copy
Delete first N matches
$ recdel -n [1] -e "[condition]" [file.rec]
copy

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

$ # 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
copy

EXPRESSIONS

$ =       - Equal
!=      - Not equal
~       - Regex match
<, >    - Comparison
&&, ||  - Logical operators
copy

INSTALL

sudo dnf install recutils
copy
sudo apk add recutils
copy
brew install recutils
copy
nix profile install nixpkgs#recutils
copy

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.

SEE ALSO

recsel(1), recins(1), recset(1), rec2csv(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid