Le Sat, 30 Jun 2012 19:48:28 +0100, Neil Bothwick <n...@digimed.co.uk> a écrit :
> On Sun, 1 Jul 2012 01:27:49 +0800, 赵佳晖 wrote: > > > In some cases , when i run somethings with "sudo" , it tells me > > "Permission Denied" , then i should turn to root . i forgot to > > record the cases . Did anyone have any ideas ? > > Are you trying to redirect the output? That can give this message > because the redirection is performed as the user running sudo, not as > root. > > If Neil is right, you may want to read man tee. It work roughly like that: instead of do sudo echo sthg > /etc/file.cfg echo sthg | sudo tee /etc/file.cfg sudo echo sthg >> /etc/file.cfg echo sthg | sudo tee -a /etc/file.cfg -- Éric DUNAND