← 返回命令列表

Linux command

recdel 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

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]

说明

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.

参数

-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.

FAQ

What is the recdel command used for?

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.

How do I run a basic recdel example?

Run `recdel -e "[Name = 'John']" [file.rec]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -t, --type _type_ do in recdel?

Record type.