Delete Directory Contents
To delete all the contents of a directory but not the directory itself in Linux, you can use the rm command with the wildcard * to target all files and folders within the directory. The command would look like this:
rm -r directory_name/*
Alternatively, you can use