Re: dapper sudo
- From: Alexander Skwar <listen@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 05 Jul 2006 10:30:04 +0200
Jack Bowling wrote:
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?
That assumption is the difference. So, yes, there IS a *HUGE* difference
between
sudo -s
echo > /var/log/apache2/error.log
(BTW: No need for the "echo" here, unless you're really after an empty
line).
and
sudo tee /var/log/apache2/error.log < /dev/null
The difference is, that the shell "executing" "> /var/log/apache2/error.log"
is run with root rights. That's actually more-or-less the same as doing
sudo sh -c " > /var/log/apache2/error.log"
Alexander Skwar
--
The more laws and order are made prominent, the more thieves and
robbers there will be.
-- Lao Tsu
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- References:
- dapper sudo
- From: boricua
- Re: dapper sudo
- From: Toby Kelsey
- Re: dapper sudo
- From: Jack Bowling
- dapper sudo
- Prev by Date: Re: Fstab and JFS
- Next by Date: Re: Firefox Hijacked?
- Previous by thread: Re: dapper sudo
- Next by thread: Re: dapper sudo
- Index(es):
Relevant Pages
|