Write to file forbidden

Norberto Bensa nbensa at gmail.com
Sun Mar 15 15:05:11 UTC 2009

On Sun, Mar 15, 2009 at 10:47 AM, GaryT <taig at melbpc.org.au> wrote:
> from the root directory.

>        e.g.    ls -s -S -R >files.txt

you -as user- have no permission on /

> adding sudo makes no difference
> using gksudo also makes no difference.

no. because redirection is still being done as user:

sudo ls -s -S -R | sudo tee files.txt >/dev/null

will work.

BTW, this' a FAQ.

More information about the ubuntu-users mailing list