Delete
Description
This command allows you to delete data at a given selector.
If the root node is deleted, an empty node of the same type will be output.
Note that if your root node is anything other than an object or array, dasel will output an empty object.
Available since v1.16.0.
Usage
If --file
is used without --out
then the source file will be updated.
Flag | Description |
---|---|
| Specify the file to query. This is required unless you are piping in data. If piping in data you can optionally pass |
| Specify the output file. If present, results will be written to the given file. If not present, results will be written to the input file (or stdout if none given). To force output to be written to stdout, pass |
| Specify the parser to use when reading the input data. This is required if you are piping in data, otherwise dasel will use the given file extension to guess which parser to use. See supported file types. |
| Specify the parser to use when writing the output data. If not provided dasel will attempt to use the See supported file types. |
| Shorthand for |
| Tells dasel to delete multiple items. See multiple. |
| Specify the selector to use. See selectors for more information. If no selector flag is given, dasel assumes the first argument given is the selector. This is required. |
| By default, dasel formats the output using the specified parser. If this flag is used no formatting occurs and the results output as a string. |
| This tells dasel to output compact data where possible. E.g. not pretty printing JSON. |
| |
| See escape html. |
Example
Delete property
Last updated