|
|
|
|
|
by Symbiote
880 days ago
|
|
When you need to rename 5000 files from abcd_small.jpg to abcd.jpg, how do you do that? rename s/_small// *_small.jpg
When you have the string ABCD_XYZ in 50 files but you need to change it to DEFG_UVW, how do you do that? perl -pi -e 's{ABCD_XYZ}{DEFG_UVW}' **/*(.)
When you need to move all the files ending '.png' into the directory 'PNG', and all the ones ending '.jpg' into 'JPG', how do you do that? mkdir JPG PNG;
for i in *.png *.jpg; mv $i $i:e:u
|
|
¹ https://zsh.sourceforge.io/Doc/Release/User-Contributions.ht...
² https://zsh.sourceforge.io/Doc/Release/Expansion.html#Filena...