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