Clear a file without changing its timestamp
- by Alex Farber
Is it possible to clear a file preserving its timestamp, using standard Linux commands? For example:
echo "" file-name
converts the text file to empty, this is OK for me. But I need to keep the timestamp unchanged.