If I try
truncate -s 0 log.log
(:>log.log
has same behavior) the displayd space on disk do become free but the size (ls -l
) of file is still the same (tho du
shows less). As far as I understand, it happens because the pointer is still "old".
This behavior causes that I cannot use cat ... | grep ...
command: CLI says that file is binary. So the only way is to use less
or another commands.
So, how do I truncate file, that is opened in write mode in another proccess and have correct file size after truncate?
I need data in log.log
to be truncated to another file, or just delete whole data in file without deleting the file itself
Asked by Sova
(23 rep)
May 10, 2021, 04:09 PM
Last activity: Feb 7, 2025, 05:18 AM
Last activity: Feb 7, 2025, 05:18 AM