Re: Write to file forbidden



GaryT wrote:
To obtain a recursive listing of all files, I'll use the command
ls -s -S -R
from the root directory.

That would be nearly all files - hidden files would stay hidden. If you
want to see ALL files, add the -A option.

BUT
When attempting to capture that list by saving it to a text file, I
get "permission denied"
e.g. ls -s -S -R >files.txt

You are not allowed to write to "/files.txt".

adding sudo makes no difference

No, it doesn't because sudo then only works for the ls command, not for
the output redirection. Try

sudo ls -sSR / >~/files.txt

which will give you a list of all files but place the output in your
home directory.

using gksudo also makes no difference.

There is no big difference between sudo and gksudo in this case because,
like sudo, it operates on the ls command not on the output redirection.


Nils

--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



Relevant Pages

  • Re: Write to file forbidden
    ... Nils Kassube wrote: ... from the root directory. ... There is no big difference between sudo and gksudo in this case because, ... it operates on the ls command not on the output redirection. ...
    (Ubuntu)
  • Re: Invisible Boot Drive?
    ... That icon is odd, but it might be a red herring. ... The most likely explanation is that the root directory of your hard ... If the hidden flag is set, ... sudo chflags nohidden / ...
    (comp.sys.mac.system)
  • OSR5.0.7: hidden files at the root directory
    ... After a fresh install of OSR 5.0.7, and once I had manually moved ... i was left with these hidden files at the root directory: ... It strikes me as quite ugly to see all those PHP4 files there, ... command, when invoked by the "root" user, always shows hidden files ...
    (comp.unix.sco.misc)
  • Re: Write to file forbidden
    ... Smoot Carl-Mitchell wrote: ... from the root directory. ... When attempting to capture that list by saving it to a text file, ... sudo command is executed. ...
    (Ubuntu)
  • Re: Removing OS X From second HD
    ... There seems to be no other hidden files. ... And for listing only, 'ls -al /' ... with no 'sudo', seems enough. ... Hans Aberg ...
    (comp.sys.mac.system)