michalczaplinski
7/26/2014 - 1:59 PM

Add a string to the beginning of each file in a folder

Add a string to the beginning of each file in a folder

for f in *; do 
  echo "whatever" > tmpfile
  cat $f >> tmpfile
  mv tmpfile $f
done