Sed command not working as expected for delete particular line from file

bash, centos, linux, sed

Solution

Make it in-line sed:

sed -i.bak '3d' file1.txt

Problem

I have try to use `sed` command for delete particular line from file but it seems not working properly in my system (CentOS release 6.3 (Final). my file1.txt contain following data ``` line1 line2 line3 line4 line5 ``` Now i try below command to delete 3rd line from the file. ``` $ sed '3d' file1.txt ``` And output of above command is ``` line1 line2 line4 line5 ``` But when i check original file then it seems nothing deleted. 3rd line is there. So any one have idea why `sed` not working?

Original source