Re: File size (shortest possible solution) + don't touch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx http://www.bcgreen.com/~samuel/ Powerful committed communication. Transformation touching the jewel within each person and bringing it to light. - : send the line "unsubscribe linux-admin" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux