I have thousands of image files that have a 10-digit number appended to the beginning of the filenames. Immediately following each string of 10 numbers is an underscore. They look like this:
1318487644_IMG_2158.jpg
I need to remove the 10dig number and the underscore, without disturbing what follows, the result of which should look like this:
IMG_2158.jpg
I'm using this command to find/replace other unwanted stuff in the filenames:
ls -1 | while read file; do new_file=$(echo $file | sed s/foo/bar/g); mv "$file" "$new_file"; done
How can I edit the above command to remove the leading 10dig+underscore combo(s) without altering the rest of the filename(s)?
rename
command?rename
is only standard in Linux.