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
Asked
Active
Viewed 390 times
1 Answers
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"
common_bot9999
- 20
- 7