第1个回答 2012-06-14
vim removefile.sh
#!/bin/sh
# remove files with name pattern matching regexp
echo -n "Enter directory: "; read dir
echo -n "Enter pattern: "; read pat
for loop in `find $dir -name "*$pat*"`
do
rm $loop && echo "$loop has been removed!"
done