From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Samuel Subject: Re: File size (shortest possible solution) + don't touch Date: Mon, 09 Aug 2004 14:14:40 -0700 Sender: linux-admin-owner@vger.kernel.org Message-ID: <4117E940.1030707@bcgreen.com> References: <20040808090045.GA31942@cmi.ac.in> <200408081725.13489.aroop@poornam.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200408081725.13489.aroop@poornam.com> List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Aroop MP Cc: Roberto Vanto , linux-admin@vger.kernel.org the shortest possible: ` > somefile ` (( redirect the output of no command at all to somefile )) Although not necessary, I'll often go ` true > somefile ` True does nothing other than return success. The reason why I like using it is that it makes a placeholder so that a reader knows that something (or rather explicitly nothing) is happening. `Touch` doesn't work.. If the file already exists, it will simply change the last mod-time. without altering the contents The original purpose of touch (I think) was to convince make(1) that something needed to be done. Anindya Mozumdar wrote: > Hi, > How can I make a file zero length without deleting the contents of > the file manually through an editor ? > Anindya. -- Stephen Samuel +1(604)876-0426 samuel@bcgreen.com http://www.bcgreen.com/~samuel/ Powerful committed communication. Transformation touching the jewel within each person and bringing it to light.