dapper sudo
Jack Bowling
jbinpg at shaw.ca
Wed Jul 5 06:41:31 UTC 2006
On Tue, Jul 04, 2006 at 02:44:14PM +0100, Toby Kelsey wrote:
> boricua wrote:
> >how come dapper does not allow me to do this
> >
> > sudo cat /dev/null > /var/log/apache2/error.log
> >
>
> Because the sudo only applies to the command 'cat', not the redirection.
>
> Try
> sudo dd of=/var/log/apache2/error.log < /dev/null
> or
> sudo tee /var/log/apache2/error.log < /dev/null
>
>
> It is a bug that there is no obvious command to truncate a file.
Could somebody tell me if there is any difference between the above cat
command and
[sudo] echo "" > /var/log/apache2/error.log
assuming one has sudo'ed to a root shell?
Jack
More information about the ubuntu-users
mailing list