Unix Command to Delete all files in a directory but preserve the directory

unix

Solution

rm -i <directory>/*

this should do the trick

EDIT: added -i just in case (safety first). directory should be a full or relative path (e.g. `/tmp/foo` or `../trash/stuffs`)

Problem

I am looking for a unix command to delete all files within a directory without deleting the directory itself. (note the directory does not contain subdirectories).

Original source