Here is a perl one liner which does what you need: perl -pi -e 's/^/127.0.0.1 /' file file ... See "man perlrun" for an explanation of the perl options that make this work. -- Smoot Carl-Mitchell Computer Systems and Network Consultant smoot at tic.com +1 480 922 7313 cell: +1 602 421 9005