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

From WickyWiki
mNo edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
[[Category:Ubuntu Images]]
[[Category:Ubuntu Images]]
[[Category:2009]]
[[Category:2009]]
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
sudo apt-get install rename
sudo apt-get install rename
rename -n 's/(\d{1,3})\.JPG$/01_$1\.jpg/' *.JPG
rename -n 's/(\d{1,3})\.JPG$/01_$1\.jpg/' *.JPG
</syntaxhighlight>
Option '''-n''' shows what will be done, remove it to do it for real:
<syntaxhighlight lang=bash>
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: