.. highlight:: xml
.. index:: delete
.. _delete:
``delete``
----------
This task deletes files and directories on the device. All files and directories matching the ``include`` regexp pattern are deleted.
Run this task in "dry run" mode first to determine what is actually going to be deleted.
Attributes/Options
^^^^^^^^^^^^^^^^^^
.. list-table::
:widths: 20 80 8
:header-rows: 1
* - Name
- Description
- Required
* - include
- Regular expression pattern defining what files and directories to delete.
The match is done against the entire path of a file, including the filesystem (e.g., ``local:/``). Note that the filesystem is separated by a single slash, i.e., the pattern ``local://.*xsd`` will not match anything.
You cannot delete the root of the filesystem, though it is possible to delete everything under the root with the pattern ``local:/(?!ondisk$).*``. Replace "ondisk" with the mountpoint of your disk array if it is not the default.
- Yes
* - matchRequired
- If set to ``true``, fail if no files matched the ``include`` pattern.
Defaults to ``true``.
- No
* - dryRun
- If set to ``true``, print the files and directories that will be deleted but don't make any changes to the device.
Defaults to ``false``.
- No
* - | domainPatterns
| CLI alias: domains
- Comma-delimited list of regular expression patterns defining what domains to apply the command to. Use '.*' for all domains except the default. Use '.*,default' to include the default domain.
Defaults to the current domain. The current domain is specified using the ``dpDomain`` property or ``domain`` attribute of the task.
- No
Examples
^^^^^^^^
Delete all "\*.xsd" files from "local:/":
.. code-block:: bat
dpbuddy delete -include="local:/.*\.xsd"
.. code-block:: xml
You can find more examples under ``samples`` in your distribution or `online `_.