I have a directory with a bunch of files with names like:
001234.jpg 001235.jpg 004729342.jpg
I want to remove the leading zeros from all file
Here's one that doesn't require sed:
sed
for x in *.jpg ; do let num="10#${x%%.jpg}"; mv $x ${num}.jpg ; done
Note that this ONLY works when the filenames are all numbers. You could also remove the leading zeros using the shell:
for a in *.jpg ; do dest=${a/*(0)/} ; mv $a $dest ; done