Use the remove and remove-directory commands to delete files and remove directories. Directories can be removed even if they contain files or subdirectories.
Use the following CLI syntax to delete files and then remove directories:
file
— remove [url] string [client-tls-profile string] [direct-http] [force] [proxy string]
— remove-directory [url] string [force] [recursive]
The following example removes the test1/test2/test3 directory.
[/file "cf3:\test1\test2"]
A:admin@node-2# list
Volume in drive cf3 on slot A is TIMOS_VM_CF.
Volume in drive cf3 on slot A is formatted as FAT32
Directory of cf3:\test1\test2
09/01/2020 08:13p <DIR> ./
09/01/2020 08:13p <DIR> ../
09/04/2020 06:36p 874 bof.cfg
04/28/2020 03:15p 11401 md-config.cfg
09/04/2020 06:43p <DIR> test3/
2 File(s) 12275 bytes.
3 Dir(s) 10641920 bytes free.
[/file "cf3:\test1\test2"]
A:admin@node-2# list test3
Volume in drive cf3 on slot A is TIMOS_VM_CF.
Volume in drive cf3 on slot A is formatted as FAT32
Directory of cf3:\test1\test2\test3
09/01/2020 08:13p <DIR> ./
09/01/2020 08:13p <DIR> ../
09/04/2020 06:43p 11788 conf3.cfg
09/04/2020 04:24p 6645 mybof.cfg
2 File(s) 18433 bytes.
2 Dir(s) 10641920 bytes free.
[/file "cf3:\test1\test2"]
A:admin@node-2# remove-directory test3 ?
remove-directory
force - Force removal without prompting
recursive - Remove directory and its content recursively
[/file "cf3:\test1\test2"]
A:admin@node-2# remove-directory test3 recursive
Deleting all subdirectories and files in specified directory. y/n ?y
Deleting file cf3:\test1\test2\test3\mybof.cfg ... OK
Deleting file cf3:\test1\test2\test3\conf3.cfg ... OK
Deleting directory cf3:\test1\test2\test3 ... OK
[/file "cf3:\test1\test2"]
A:admin@node-2# list
Volume in drive cf3 on slot A is TIMOS_VM_CF.
Volume in drive cf3 on slot A is formatted as FAT32
Directory of cf3:\test1\test2
09/01/2020 08:13p <DIR> ./
09/01/2020 08:13p <DIR> ../
09/04/2020 06:36p 874 bof.cfg
04/28/2020 03:15p 11401 md-config.cfg
2 File(s) 12275 bytes.
2 Dir(s) 10661376 bytes free.