I want to do zero-padding for names of files. what should I do if not all images exist like 1.JPEG doesn't exist or 99.JPEG or 110.JPEG ?
$ for n in $(seq 9); do mv $n.JPEG 0$n.JPEG; done; mv: cannot stat ‘1.JPEG’: No such file or directory
I do not want to rename manually because order of videos are important.
find
command and itsexec
? – Michal Przybylowicz Nov 10 '19 at 18:21rename
with a simple shell glob - that avoids having to generate filenames – steeldriver Nov 10 '19 at 18:32for n in $(seq 9); do if [[ -f $n.JPEG ]]; then mv $n.JPEG 0$n.JPEG; fi done;
. – Kulfy Nov 10 '19 at 18:32