bash string split Oct 21, 2008 • {"display_name"=>"Marcus Puchalla", "login"=>"admin", "email"=>"cb0@0xcb0.com", "url"=>""} I have a bunch of files named 123_345.ab all should be renamed to 123.ab for i in $(ls .); do mv $i ${i%_*}.ab done If you need the 2nd part of the filename ${i#*_} instead