[NTLUG:Discuss] How do I make all files in a directory of zero length?
A.L.Lambert
max at xjack.org
Wed Jun 6 12:34:06 CDT 2001
> I want to go into a directory and make all the files of zero length.
> What's the easiest way to do this?
>
> Do I need to save the filenames, delete the files, and then touch the
> saved filenames?
>
> Is there a more direct way to achieve the result I'm looking for?
cd /path/dir/ ; for i in * ; do echo -n > $i ; done
--
A.L.Lambert
------------------------------------------------------------------------
The problems that exist in the world today cannot be solved by the level
of thinking that created them...
-Einstein
------------------------------------------------------------------------
More information about the Discuss
mailing list