rm */t* will not remove recursively will it? It will only remove files beginning with a t in all directories one level down (at least that is what happens on our systems here....)
Also,
rm -rf t* does not work because this will remove directories AND files that start with a t.
Also,
rm -f `find /tmp|grep t*` will also remove directories will it not?
So, I think you may have to add the
-type f switch to find to insure that directories are not removed, right? Becomes:
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
Which implies that the suggestion
find /tmp/ -name "t*" -exec rm -i {} \;
Also does not work
because find returns the full path name on our systems. From here, seems like Perderabo's"
find /tmp \( ! -name /tmp -prune \) -type f -name t\*....
However, This does not work for me either !!!!
I suggest a variation of:
find /tmp -type f -regex .*\/t[^\/]*$ -exec rm {} \;
Which should work right??
It finds only regular files, searches for t's after / and insures that no more /s exist before the end of the filename, then removes it......
BTW:
Here is a URL to a summary for how to use regex (regular expressions)
Click
here for an even better page on Regular Expressions ....
To get a feel for what the expression can do try this:
find / -type f -regex .*\/t[^\/]*$ | more
This seems to work on our systems ......