Batch rename all files in a directory to basename-sequentialnumber.extention
问题 I have a directory containing .jpg files, currently named photo-1.jpg , photo-2.jpg etc. There are about 20,000 of these files, sequentially numbered. Sometimes I delete some of these files, which creates gaps in the file naming convention. Can you guys help me with a bash script that would sequentially rename all the files in the directory to eliminate the gaps? I have found many posts about renaming files and tried a bunch of things, but can't quite get exactly what I'm looking for. For