5 ms·
Well, `echo > file` won't empty the file, it will have a newline in it. At the very least you'll need `echo -n > file`.
by chaosite 7y ago
Well, `echo > file` won't empty the file, it will have a newline in it. At the very least you'll need `echo -n > file`.
- luckman212 7y agoTrick: You can use just >file
- leviathan 7y agoI've always done it as: `> file`
- naniwaduni 7y agoOr after thinking about it for a moment, true > file. Or by its shorter name, :> file.
- hultner 7y ago`printf > file`, but there's endless ways of achieving the same thing (and that's part of the beauty).