$ touch data/{1..5}\ with\ spaces.dat $ perl -le'for(){print}' $ perl -le'for(){$o=$_;tr/ /_/;print}' $ perl -le'for(){$o=$_;tr/ /_/;rename $o,$_}'