Emptying a file used by another Process - TechRepublic
General discussion
August 9, 2004 at 07:24 PM
blue_throat1

Emptying a file used by another Process

by blue_throat1 . Updated 21 years, 9 months ago

I have a file that is being updated by a process. I try to empty it using the command:
echo > filename
When I do this and do a df -k ., it shows that the space occupied has reduced after the operation. But when I do a ls -l on that file, I find that the file size is the same. Can somebody please explain how this happens. Is there any other ways of emptying a file that is used by another process?

This discussion is locked

All Comments