-1

I have a file which has 7375 lines and i need to add ls -l to the beginning of every line. How could i do this with sed?

Weylyn Savan
  • 553
  • 3
  • 8
  • 18

1 Answers1

1

Search for the beginning of a line with ^ and replace it with your desired string ls -l with sed's s/search/replace/

Your command would look like:

$ sed 's/^/ls -l /' file
John Goofy
  • 911
  • 1
  • 6
  • 17