Command help

Jordon Bedwell jordon at
Thu Aug 11 06:18:17 UTC 2011

On Wed, August 10, 2011 10:18 pm, nathan nolast wrote:
> can someone please inform me how this works
>> filename.txt
> this emptys the file but i cant find what > is doing, what is >

It's called stdio redirection or some (well actually a lot of) people just
call it I/O redirection.  You can redirect stdin and you can redirect.  <<
< stdin stdout > >>, the proper way to truncate a file is actually ">
file.txt" or ":> file.txt" and nothing more, no echo, with an echo of any
kind you always end up with at least 1 byte written to the file which
defeats the purpose of what you are trying to do if you want to down and
dirty about it.

More information about the ubuntu-users mailing list