Question: I am trying to release space in my server's hd so I'm matching old dates in a log file with sed and it is decreasing but my root partition is now using 98% percent of it's space instead of 91% it was using before I invoke sed.
I did this `sed -i '/^Jan/ d' file.log` and my log file decrease from 6G to 400M.
I'm using `find / -size +1G` trying to search a temporal file or something like that but it's not matching new files.
**Edit:** I did `echo -n > file.log` to avoid a service crash but it's temporal because the issue remains

Answer: 
The `--in-place` option to sed cannot really edit a file in place, so it actually does the equivalent of:

```
if sed ... input > /tmp/output$$ ; then
    mv /tmp/output$$ input
else
    rm /tmp/output$$
fi

```

which means prior to the `mv` command you can double (or worse) the size of the input file on disk. When file-systems reach nearly full, they become dreadfully less efficient.

It sounds like the larger problem is that you are just plain out of disk-space or you have /var/log and /tmp mounted on the same partition as / and if / is on a small partition, you will overfill it now and next week and the week after that, etc.

Look at `mount` and `df /tmp` and `df /var/log` to see how your disk is set up. You either need to:

1. fix the disk mounting
2. get a larger disk
3. look into `logrotate`
4. stop logging so much
5. or some combination of the above
Running strace on the sed -i should make it pretty obvious where it's putting the temporary files. But the easiest thing to do is not use -i. Redirect the output to a file on a partition where you have space.