Rename 'JPG' to 'jpg': Difference between revisions

From WickyWiki
mNo edit summary
mNo edit summary
 
Line 8: Line 8:
</syntaxhighlight>
</syntaxhighlight>


Option '''-n''' shows what will be done, remove it to do it for real.
Option '''-n''' shows what will be done, remove it to do it for real:


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
rename -n 's/(\d{1,3})\.JPG$/01_$1\.jpg/' *.JPG
rename 's/(\d{1,3})\.JPG$/01_$1\.jpg/' *.JPG
</syntaxhighlight>
</syntaxhighlight>


See also:
See also:
* [[Rename file to include date and time its modified date]]
* [[Rename file to include date and time its modified date]]

Latest revision as of 20:57, 5 April 2017


sudo apt-get install rename
rename -n 's/(\d{1,3})\.JPG$/01_$1\.jpg/' *.JPG

Option -n shows what will be done, remove it to do it for real:

rename 's/(\d{1,3})\.JPG$/01_$1\.jpg/' *.JPG

See also: