Lxc file delete - a folder inside a container?

Hi people!
Good to see that lxc/lxd is still around and there’s an active community so I give it another try :wink:
Here’s my first question:

Is it possible to delete the content of a folder inside a container with lxc command?

I tried:
lxc file delete containername/pathtofile/*

this is telling me file not found.
and when I try:
lxc file delete containername/pathtofile

it tells me that the folder is not empty.

the lxc file delete command seems not to take flags like -r or -rf.

Has someone a solution for that?
Would really appreciate your help :slight_smile:

1 Like

I don’t think you can do that, as that file delete command is for file management.

You could do:

lxc exec <instance> -- rm -rf /path/to/delete

thanks for the awesome information.

Thank you @tomp! That works for me just fine :slight_smile:

1 Like