Of course in the you can modify the printf command to change the zero padding length from 3 to any other number. maxdepth 1 -type f -name 'file*.txt'` \ So in your case, the simple solution (in case the maximum number is 3 digit long) would be: rename file file00 file?.txtīefore run the actual rename command, you can test it by adding -no-act / -n and -verbose / -v flags to see what would be the outcome: $ rename -nv file file00 file?.txtĪ more general solution (available since bash version 3.0): $ for i in `find. In the manual pages rename(1), you can see an example to do that: EXAMPLES
0 Comments
Leave a Reply. |