sed - Bash command to remove leading zeros from all file names -


i have directory bunch of files names like:

001234.jpg 001235.jpg 004729342.jpg 

i want remove leading zeros file names, i'd left with:

1234.jpg 1235.jpg 4729342.jpg 

i've been trying different configurations of sed, can't find proper syntax. there easy way list files in directory, pipe through sed, , either move or copy them new file name without leading zeros?

for file in `ls`; mv $file `echo $file | sed -e 's:^0*::'`; done 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -