0

I want to insert text before the first line of a file. I want to use sed and command sed -i '1s/^/line_to_be_added\n/' file.txt works fine, but when I want to add directory path and use slashes in command I get an error sed: -e expression #1, char 9: unknown option tos'. My command sed -i '1s//var/log/firstlogs/logs/first.json\n/' file.txt How to escape slashes in this case?

mila002
  • 327
  • 3
  • 14

0 Answers0