I have readable pdf files that all contain the string VAX followed by eight numbers, like VAX00002885.Now I want to find that expression and rename the corresponding pdf to  VAX00002885.pdf (in this case).How can I do this?
grep search expression and rename file
sed;grep;perl
Try this (assuming GNU grep):for pdf in *pdf; do    mv $pdf $(grep -aE 'VAX[0-9]*' $pdf | sed 's/.*\(VAX[0-9]*\).*/\1/)doneNote that this assumes only one instance of VAXNNNNNNN. If you can have more, use the first match only:for pdf in *pdf; do    mv $pdf $(grep -m 1 -aE 'VAX[0-9]*' $pdf | sed 's/.*\(VAX[0-9]*\).*/\1/)done