On Thursday 23 March 2006 16:33, JimD <[EMAIL PROTECTED]> wrote 
about 'Re: [gentoo-user] sudo echo':
> If you type something like the following:
>
> "> /tmp/myfile.foo"
>
> It will truncate the file.  I use it when I want to clear out logs real
> quick.  I can sudo su and then just type (without the quotes):
>
> "> /var/log/mail/current"
>
> and have a clean log.  However to do that I need to be root and the
> only thing I found is to sudo su and then type the command and then
> exit from root.

Try:
sudo /bin/bash -c '> /var/log/mail/current'
or, if that doesn't work:
sudo /bin/bash -c ': > /var/log/mail/current'

Shells handle redirection and pipes, sudo does not, AFAIK.

-- 
"If there's one thing we've established over the years,
it's that the vast majority of our users don't have the slightest
clue what's best for them in terms of package stability."
-- Gentoo Developer Ciaran McCreesh
-- 
gentoo-user@gentoo.org mailing list

Reply via email to