0

I have a line to be added to 3rd line of all files in directory. What's the commandline to do this operation Lets say I want to add "color #c2451 " to 3rd line of files in Class directory

1 Answers1

0

Try and use the find cmd piped into xargs and the sed cmd. You'd have to cd into the directory first with the files.

find . -type f -name '*' | xargs sed -i "3i color #c2451"

Add text to file at certain line in Linux

Change multiple files