another option :
find /some/path/ -type f -exec rm -f '{}' \;
this will only delete files of type f which is a regular file
make sure you test it first with only the find statement.
find /some/path/ -type f
from the manpage of find
-type c
File is of type c:
b block (buffered) special
c character (unbuffered) special
d directory
p named pipe (FIFO)
f regular file
l symbolic link; this is never true if the -L option or the -follow option is in effect, unless the symbolic link is broken. If you want to search for symbolic links when -L is in
effect, use -xtype.
s socket
D door (Solaris)
Regards
Tjilp
Main Topics
Browse All Topics





by: maysaraPosted on 2008-09-03 at 01:10:43ID: 22374953
Hello, your command is pretty correct, just specify what you want to delete correctly:
e relative pathnames , example
if you have /home/test/directory/
and you want to delete its content you can
A) 1- cd to that directory
2- rm -Rf *
B) user absolute path names:
rm -Rf /home/test/directory/*
C)us
1) cd /home/test
2) rm -Rf directory/*