Skip to content

Instantly share code, notes, and snippets.

@yasutomo57jp
Created May 31, 2013 05:14
Show Gist options
  • Save yasutomo57jp/5683044 to your computer and use it in GitHub Desktop.
Save yasutomo57jp/5683044 to your computer and use it in GitHub Desktop.
#思いついたやり方
#!/bin/zsh
y=0; for x in `ls`; do; z=`printf "%04d" $y`; ((y=$y+1)); mv $x ${z}.jpg; done
#教えてもらったやり方
#!/bin/zsh
max=$(ls -1|wc -l); paste <(ls -1) <(seq $max | xargs printf "%04d.jpg\n") | xargs -n 2 mv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment