Для прямого ответа на вопрос "нет - Вы не можете сделать то, с чем Вы описываете rm
".
Можно, однако, сделать это, Вы комбинируете его с find
. Вот один из многих способов, которыми Вы могли сделать это:
# search for everything in this tree, search for the file pattern, pipe to rm
find . | grep <pattern> | xargs rm
Например, если Вы хотите уничтожить все * ~ файлы, Вы могли так это:
# the $ anchors the grep search to the last character on the line
find . -type f | grep '~'$ | xargs rm
Расшириться от comment*:
# this will handle spaces of funky characters in file names
find -type f -name '*~' -print0 | xargs -0 rm