Article 5BX5T How to zero out the content of a file?

How to zero out the content of a file?

by
Grabby
from LinuxQuestions.org on (#5BX5T)
I need to zero out the contents of all the files in a given directory, including all its sub-directories, recursively.

The intended result would be that all the files have the size of 0 bytes, while their file names and paths are unchanged.

Can someone help me? Thanks.

EDIT: I guess the solution involves overwriting each file with an empty (0 bytes of size) file. But still I do not know how to do this recursively.latest?d=yIl2AUoC8zA latest?i=3bPmaXWogVI:QdhFQWIoLg8:F7zBnMy latest?i=3bPmaXWogVI:QdhFQWIoLg8:V_sGLiP latest?d=qj6IDK7rITs latest?i=3bPmaXWogVI:QdhFQWIoLg8:gIN9vFw3bPmaXWogVI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments