Quote:
Originally posted by Neo
From here, seems like Perderabo's"
find /tmp \( ! -name /tmp -prune \) -type f -name t\*....
However, This does not work for me either !!!! 
Oppps! How about
:
cd /
find tmp \( ! -name tmp -prune \) -type f -name t\*....
This time I tested it. I should know better than to post something like that without testing.
stuff like "rm t*" would seem to address the OP's original question until you notice the "-mtime" in his example.
Another concern is that "rm t*" will work only if there are a small number of files that start with t. Create 20,000 files that start with t in /tmp and now it will blow that max command line size on most versions of unix.
Quote:
Originally posted by Neo
rm -f `find -type f /tmp|grep t*
However, this also has problems because find returns the full path name so the syntax above will not work, seems to me
You need the path list as the first thing in a find command. So
rm -f `find /tmp -type f |grep t*`
will sort-of work. "grep t*" is going to match anything with zero or more t's in it, so that's not what we want. Also this will decend into subdirecties which is not what the op wanted.
This is nothing wrong with feeding full path names to rm except that it exacerbates the limited command line problem.
Once we have the find statement, rather than ending it with "-exec rm {} \;", I like "-print | xargs rm" which will fire up only as many rm processes as is needed rather than one per file. If someone does have 20,000 file that start with t, the difference is dramatic.