Rename a batch of files

 
# Method 1 
for f in sometext_*.jpg
do 
  mv -v "$f" "$(echo "$f" | sed -e 's/sometext_//' - )"
done

# Method 2
find . -name "sometext_*.jpg" | while IFS= read -r f; do 
   mv -v "$f" "$(echo "$f" | sed -e 's/^\.\/sometext_//' - )"; 
done

 

Related Snippets

•  Delete a batch of files using a regular expression with the find command