I have a sample dir
as follows:
/path/to/dir/
- f1.txt
- f2.txt
- f3.txt
I want to clear or remove all the files under /path/to/dir
without actually deleting the directory /path/to/dir
itself.
How to do it?
Currently, I am just using the rm -rf /path/to/dir
command to remove the directory and the creating the directory again using mkdir /path/to/dir
. But this command deletes the directory also.