Horje
rename files sequentially linux Code Example
rename files sequentially linux
### Try to use a loop, let, and printf for the padding:
# using the -i flag prevents automatically overwriting existing files, 
# using -- prevents mv from interpreting filenames with dashes as options.

a=1
for i in *.jpg; do
  new=$(printf "%04d.jpg" "$a") #04 pad to length of 4
  mv -i -- "$i" "$new"
  let a=a+1
done

# Here's the same example as a 1-liner:
for i in *.jpg; do new=$(printf "%04d.jpg" "$a"); mv -i -- "$i" "$new"; let a=a+1; done




Shell

Related
linux user expiration Code Example linux user expiration Code Example
download chromium-browser/libffmpeg.so Code Example download chromium-browser/libffmpeg.so Code Example
noetic catkin tools install Code Example noetic catkin tools install Code Example
install openjdk ubuntu Code Example install openjdk ubuntu Code Example
find and kill android device offline on Mac Code Example find and kill android device offline on Mac Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10