How to replace the n-th line in a file with a new line in Unix?

sed -i” ’10 d’ filename # d stands for delete
sed -i” ’10 i new inserted line’ filename # i stands for insert

Category: UNIX Interview Questions.