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

•  Examples of the wget command
•  Examples of the curl command
•  Examples of the zip command
•  Delete a batch of files using a regular expression with the find command