Use sed to replace string in multiple files

sed -i ‘s/Xm\(s\|x\)[[:digit:]]*m/Xmx\12048m/g’ /usr/lib/idea/bin/idea.vmoptions /usr/lib/idea/bin/idea64.vmoptions

 

This line will replace

-Xms???m and -Xmx???m to the following in files: idea.vmoptions and idea64.vmoptions

-Xms2048m

-Xmx2048m