Originally Posted by Bobbic
i have a problem with the sed order. I want to delete the first 5 lines of my file file.dat.
sed -e "1,5d" "file.dat"
to solve it. The console shows the correct result but the deleted lines are not saved in the file.dat. If i open the file.dat it contains the 5 lines.
Do you know why?
You misunderstand the way sed and the other UNIX text processing tools work. sed takes some input, processes it and writes it to the output.
There is indeed a switch that changes this behaviour - -i. Yes, do check the man page or, perhaps better, the sed manual https://www.gnu.org/software/sed/manual/sed.html